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. createBuildConfig in scripts/build-desktop-artifact.ts sets no nsis block, so electron-builder applies oneClick: true and allowToChangeInstallationDirectory: false, fixing the install to %LOCALAPPDATA%\Programs\....
Proposed solution
apps/desktop/resources/installer.nsh — auto-detected via getResource(this.options.include, "installer.nsh") in NsisTarget.ts, so no change to build-desktop-artifact.ts and no new config key:
!macro preInit
ReadEnvStr $0 "T3CODE_INSTALL_DIR"
${if} $0 != ""
SetRegView 64
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$0"
SetRegView 32
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$0"
${endif}
!macroend
preInit runs at the top of .onInit, before multiUser.nsh reads InstallLocation to 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, HKCU only. No installer UI, no nsis config block.
Alternatives considered
- Pre-seeding
InstallLocation manually. Works per electron-builder's docs, but requires computing UUIDv5(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.
- A junction from
%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
Contribution
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