Skip to content

feat(desktop): let the user choose where Windows installs CoDev - #268

Merged
quickbeard merged 1 commit into
mainfrom
installer-location-choice
Aug 19, 2026
Merged

quickbeard merged 1 commit into
mainfrom
installer-location-choice

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

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.

Page 1  Choose installation mode
        ( ) Anyone who uses this computer
        (o) Only for me (mnguy)              <- default, no admin needed

Page 2  Choose install location
        [ C:\Users\mnguy\AppData\Local\Programs\CoDev ] [Browse]

Page 3  Installing…
Page 4  Finish  [x] Run CoDev

Why these settings, and not fewer

allowToChangeInstallationDirectory is the directory page, and electron-builder throws when it is set with oneClick: true ("makes sense only for assisted installer"). oneClick: false on 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.nsh inserts it whenever INSTALL_MODE_PER_ALL_USERS is undefined, which is any build with perMachine !== 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: false stays, "only for me" stays the default, and a user who wants all-users can choose it and accept the elevation.

installerHeaderIcon is dropped: configureDefines reads it only in the one-click branch. Assisted wizards use installerHeader/installerSidebar bitmaps, 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 to isSilent = false, and NsisUpdater.doInstall appends /S only when isSilent. 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). isForceRunAfter is honoured only alongside isSilent (BaseUpdater.quitAndInstall uses autoRunAppAfterInstall otherwise), 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 to sanitizedName only for a one-click per-user install, so with oneClick: false the default directory is productFilename — CoDev, not codev. 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.name remains load-bearing — it still names the updater cache directory (codev-updater) and feeds the deb name — 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 baked app-update.yml still reads updaterCacheDirName: codev-updater. Desktop suite 138 pass / 0 fail; typecheck clean. electron-builder.config.test.ts pins 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

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>
@quickbeard
quickbeard merged commit 1509e52 into main Aug 19, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the installer-location-choice branch August 19, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant