[Feature]: Support an install directory outside %LOCALAPPDATA% on Windows #6972
alex-glez-felix
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
Build, CI, or release tooling
Problem or use case
Managed corporate Windows machines commonly exclude a dedicated volume from real-time scanning so dev tooling is usable, and scan the system volume aggressively. Given the file count in #5876 — 14,687 files written at install, each a separate open/stat/scan on a cold start — the install location matters for startup cost on these machines.
T3 Code cannot target that volume.
createBuildConfiginscripts/build-desktop-artifact.tssets nonsisblock, so electron-builder appliesoneClick: trueandallowToChangeInstallationDirectory: false, fixing the install to%LOCALAPPDATA%\Programs\....Proposed solution
apps/desktop/resources/installer.nsh— auto-detected viagetResource(this.options.include, "installer.nsh")inNsisTarget.ts, so no change tobuild-desktop-artifact.tsand no new config key:preInitruns at the top of.onInit, beforemultiUser.nshreadsInstallLocationto pick$INSTDIR. Unset variable means today's behavior, unchanged.Why this matters
Unblocks installs on machines where the system volume is scanned and a dev volume is not.
Smallest useful scope
The macro above,
HKCUonly. No installer UI, nonsisconfig block.Alternatives considered
InstallLocationmanually. Works per electron-builder's docs, but requires computingUUIDv5(appId, 50e065bc-3134-11e6-9bab-38c9862bdaf3)and a manual registry edit — not something to ask of users on a managed machine.oneClick: false+allowToChangeInstallationDirectory: true. Adds installer pages for every user.%LOCALAPPDATA%. Exclusions match the accessed path, so the I/O is still scanned.Risks or tradeoffs
Takes effect on install only, not on an existing one. Per-user path only; an elevated per-machine installer would not inherit the user environment. Needs a line in the Windows install docs to be discoverable.
Examples or references
templates/nsis/multiUser.nsh— readsInstallLocation, falls back to$LocalAppData\Programstemplates/nsis/include/installer.nsh— rewrites it each install, so the override persists across updatesContribution
All reactions