diff --git a/install-lazygit.ps1 b/install-lazygit.ps1 index 096bdbb..33d4d76 100644 --- a/install-lazygit.ps1 +++ b/install-lazygit.ps1 @@ -308,7 +308,12 @@ function Install-Lazygit { $destPath = Join-Path $InstallDir "lazygit.exe" Write-Info "Installing: $destPath" - Copy-Item -Path $lazygitExe.FullName -Destination $destPath -Force + + try { + Copy-Item -Path $lazygitExe.FullName -Destination $destPath -Force + } catch { + Write-Err "lazygit.exe is currently running. Please close lazygit and run this script again." + } Write-Success "Installation complete!"