Repository navigation
feat(desktop): let the user choose where Windows installs CoDev - #268
Merged
Merged
Conversation
The installer was one-click: no pages, no questions, and no way to put the app anywhere but the default. Make it assisted and add the directory page, so the user can take the default location or browse for their own. allowToChangeInstallationDirectory is rejected outright when oneClick is true, so both move together. perMachine stays false: the install-mode page (all users / only for me) comes with any assisted installer and cannot be suppressed without forcing per-machine, so it is there, but only-for-me remains the default and nothing needs admin rights. Updates install with /S. quitAndInstall() defaults to isSilent = false, which for an assisted installer would walk every update through the full wizard and re-ask for a location the user already chose; isForceRunAfter is honoured only alongside isSilent, so both arguments are set. Knock-on to #266, now corrected in the config comment, DIVERGENCES and CHANGELOG: the Windows install directory no longer derives from extraMetadata.name. getWindowsInstallationDirName falls back to sanitizedName only for a one-click per-user install, so the default is productFilename ("CoDev") instead of "codev". The override still names the updater cache directory, which is what keeps it load-bearing. Verified by packaging: electron-builder logs `oneClick=false perMachine=false` and app-update.yml still reads `updaterCacheDirName: codev-updater`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Windows installer was one-click: no pages, no questions, and no way to put the app anywhere but the default. It now asks two things — install mode, then location, with the usual place prefilled and a Browse button beside it.
Why these settings, and not fewer
allowToChangeInstallationDirectoryis the directory page, and electron-builder throws when it is set withoneClick: true("makes sense only for assisted installer").oneClick: falseon its own drops the page silently. So the two move together, and the on-conflict note in DIVERGENCES says so.The install-mode page is not optional.
assistedInstaller.nshinserts it wheneverINSTALL_MODE_PER_ALL_USERSis undefined, which is any build withperMachine !== true— so the only way to remove it is to force per-machine installs on everyone, taking admin rights and a UAC prompt on every update with it.perMachine: falsestays, "only for me" stays the default, and a user who wants all-users can choose it and accept the elevation.installerHeaderIconis dropped:configureDefinesreads it only in the one-click branch. Assisted wizards useinstallerHeader/installerSidebarbitmaps, and with none supplied electron-builder falls back to the stock NSIS sidebar. Authoring those is a design task, not a blocker.Updates stay silent — this is the load-bearing part
quitAndInstall()defaults toisSilent = false, andNsisUpdater.doInstallappends/Sonly whenisSilent. With a one-click installer that default was harmless. With an assisted one it would run the full wizard on every auto-update, re-asking install mode and directory for a location the user already picked — a direct regression against #265, which just made updates something the user controls.So
quitAndInstall(true, true).isForceRunAfteris honoured only alongsideisSilent(BaseUpdater.quitAndInstallusesautoRunAppAfterInstallotherwise), so both arguments are needed to install quietly and relaunch. The two files have to stay in step; DIVERGENCES records that in both rows.Correction to #266
#266 said the install directory comes from
extraMetadata.name. That stops being true here:getWindowsInstallationDirName(appInfo, !oneClick || isPerMachine)falls back tosanitizedNameonly for a one-click per-user install, so withoneClick: falsethe default directory isproductFilename—CoDev, notcodev. Better branding as it happens, but it makes three merged claims stale, all corrected in this PR: the config comment, the DIVERGENCES row and rebrand-gaps bullet, and the CHANGELOG entry (still Unreleased, so amended rather than contradicted).extraMetadata.nameremains load-bearing — it still names the updater cache directory (codev-updater) and feeds thedebname — so nothing from #266 is reverted.Verification
Packaged an x64 build: electron-builder logs
building target=nsis file=…win-x64.exe archs=x64 oneClick=false perMachine=false, and the bakedapp-update.ymlstill readsupdaterCacheDirName: codev-updater. Desktop suite 138 pass / 0 fail; typecheck clean.electron-builder.config.test.tspins all three nsis options, since each fails differently and none of them show up in a build log.Not verified: the wizard's actual appearance, which means running the installer on a real machine. Worth a manual pass before release — the page flow above is read from the NSIS templates, not observed.
🤖 Generated with Claude Code