Skip to content

fix(plugin-windows): wire perUserInstall to MSI perMachine#224

Merged
kdroidFilter merged 1 commit into
mainfrom
fix/msi-per-user-install
May 5, 2026
Merged

fix(plugin-windows): wire perUserInstall to MSI perMachine#224
kdroidFilter merged 1 commit into
mainfrom
fix/msi-per-user-install

Conversation

@kdroidFilter
Copy link
Copy Markdown
Collaborator

@kdroidFilter kdroidFilter commented May 5, 2026

Summary

  • Map windows.perUserInstall (DSL) to electron-builder's msi.perMachine (inverted) in ElectronBuilderConfigGenerator. The flag was declared but never emitted in the generated electron-builder.yml, so MSI installers always used electron-builder's default perMachine=false (ALLUSERS=2) regardless of the DSL value.
  • One-line change in ElectronBuilderConfigGenerator.kt under the TargetFormat.Msi branch.

Behavior

perUserInstall msi.perMachine ALLUSERS Install path
false (default) true 1 C:\Program Files\<app>
true false 2 %LOCALAPPDATA%\Programs\<app>

Mapping confirmed against electron-builder upstream (CommonWindowsInstallerConfiguration.ts:12, templates/msi/template.xml:39-44).

Test plan

  • :example:packageMsi builds successfully.
  • perUserInstall = false (default): MSI inspected via WindowsInstaller.Installer COM → ALLUSERS=1. Installed → app lands in C:\Program Files\NucleusDemo.
  • perUserInstall = true: MSI rebuilt and inspected → ALLUSERS=2, MSIINSTALLPERUSER=1. Installed → app lands in C:\Users\<user>\AppData\Local\Programs\NucleusDemo.
  • UpgradeCode correctly carried through from windows.upgradeUuid in both runs.

Closes #222

The DSL flag windows.perUserInstall was declared but never mapped to
electron-builder's MSI configuration, so MSI installers always fell back
to electron-builder's default perMachine=false (ALLUSERS=2), forcing a
per-user install in %LOCALAPPDATA%\Programs regardless of the DSL value.

Map perUserInstall to msi.perMachine (inverted) so:
 - perUserInstall=false (default) -> perMachine=true  -> ALLUSERS=1, install in C:\Program Files
 - perUserInstall=true            -> perMachine=false -> ALLUSERS=2, install in %LOCALAPPDATA%\Programs

Closes #222
@kdroidFilter kdroidFilter merged commit 6354506 into main May 5, 2026
22 checks passed
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.

[Windows] packageMsi: perUserInstall = false leads to per user install anyways

1 participant