fix: Windows installer places app in permanent location#76
Conversation
…nu entry Move artifactName from win level to target-specific sections so the portable exe no longer overwrites the NSIS installer. Add explicit NSIS config for desktop/Start Menu shortcuts. PS1 script now verifies installation and adds install dir to user PATH. Fixes #75
There was a problem hiding this comment.
Pull request overview
Fixes Windows installation behavior by ensuring the release publishes distinct NSIS installer vs portable artifacts, and updates the PowerShell installer to validate and surface the real per-user install location.
Changes:
- Split Windows
artifactNameinto target-specific names so portable no longer overwrites the NSIS installer. - Add explicit NSIS configuration to create desktop/Start Menu shortcuts and use a wizard (non-one-click) installer.
- Update
install.ps1to check installer exit code, verify install at%LOCALAPPDATA%\Programs\VibeGrid, and add the install directory to the user PATH.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| install.ps1 | Adds installer exit-code handling, install verification, PATH update, and clearer final output. |
| electron-builder.yml | Separates Windows artifact naming by target and adds NSIS shortcut/install UX configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
install.ps1
Outdated
| if ($UserPath -notlike "*$InstallDir*") { | ||
| [Environment]::SetEnvironmentVariable("Path", "$UserPath;$InstallDir", "User") |
There was a problem hiding this comment.
When updating the user PATH, concatenating with ";" can create empty PATH entries (e.g., if $UserPath is null/empty, or already ends with ';'), which Windows interprets as the current directory. Consider normalizing PATH entries (split on ';', trim, drop empties), checking for an exact match of $InstallDir, and then re-joining to avoid introducing empty components or substring false-positives.
| if ($UserPath -notlike "*$InstallDir*") { | |
| [Environment]::SetEnvironmentVariable("Path", "$UserPath;$InstallDir", "User") | |
| $pathEntries = @() | |
| if ($UserPath) { | |
| $pathEntries = $UserPath -split ';' | ForEach-Object { $_.Trim() } | Where-Object { $_ } | |
| } | |
| if (-not ($pathEntries -contains $InstallDir)) { | |
| $pathEntries += $InstallDir | |
| $newPath = ($pathEntries -join ';') | |
| [Environment]::SetEnvironmentVariable("Path", $newPath, "User") |
There was a problem hiding this comment.
Fixed in 9f96bbb — PATH entries are now split, trimmed, and filtered before checking with -contains.
electron-builder.yml
Outdated
| perMachine: false | ||
| createDesktopShortcut: true | ||
| createStartMenuShortcut: true | ||
| shortcutName: VibeGrid |
There was a problem hiding this comment.
Hard-coding shortcutName: VibeGrid can drift from productName if that value ever changes. Since the default shortcut name already follows the product name, consider removing shortcutName (or otherwise deriving it from the existing productName) to keep configuration consistent.
| shortcutName: VibeGrid |
There was a problem hiding this comment.
Removed in 9f96bbb — defaults to productName already.
install.ps1
Outdated
| if ($process.ExitCode -ne 0) { | ||
| Write-Error "Installer exited with code $($process.ExitCode)." | ||
| exit 1 | ||
| } | ||
|
|
||
| # Verify installation at the default per-user location | ||
| $InstallDir = Join-Path $env:LOCALAPPDATA "Programs\$AppName" | ||
| $ExePath = Join-Path $InstallDir "$AppName.exe" | ||
|
|
||
| if (-not (Test-Path $ExePath)) { | ||
| Write-Error "Installation could not be verified — $ExePath not found." | ||
| Write-Host "Try running the installer manually: $InstallerPath" | ||
| exit 1 | ||
| } |
There was a problem hiding this comment.
The early exit 1 paths (non-zero installer exit code / failed verification) now skip the cleanup step, leaving %TEMP%\vibegrid-install behind. If the intent is to always remove temp files after an attempted install, consider ensuring cleanup runs via try { ... } finally { ... } (or explicitly cleaning up before exiting).
There was a problem hiding this comment.
Fixed in 9f96bbb — post-download steps are now wrapped in try/finally so temp dir is always cleaned up.
- Use split/filter/contains for PATH check instead of substring match - Wrap post-download steps in try/finally so temp dir is always cleaned up - Remove redundant shortcutName (defaults to productName)
Summary
artifactNamewas set at thewinlevel inelectron-builder.yml, applying to bothnsisandportabletargets. Both producedVibeGrid-Setup-{version}.exe— the portable exe overwrote the NSIS installer. The PS1 script downloaded a standalone portable exe instead of the actual installer, so nothing was registered.artifactNameto target-specific sections (nsis→Setup,portable→Portable)%LOCALAPPDATA%\Programs\VibeGrid, adds install dir to user PATH, and reports the install locationTest plan
VibeGrid-Setup-{v}.exeandVibeGrid-Portable-{v}.exeinstall.ps1— app should install to%LOCALAPPDATA%\Programs\VibeGridVibeGridin a new terminalFixes #75