fix(plugin-windows): wire perUserInstall to MSI perMachine#224
Merged
Conversation
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
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.
Summary
windows.perUserInstall(DSL) to electron-builder'smsi.perMachine(inverted) inElectronBuilderConfigGenerator. The flag was declared but never emitted in the generatedelectron-builder.yml, so MSI installers always used electron-builder's defaultperMachine=false(ALLUSERS=2) regardless of the DSL value.ElectronBuilderConfigGenerator.ktunder theTargetFormat.Msibranch.Behavior
perUserInstallmsi.perMachineALLUSERSfalse(default)true1C:\Program Files\<app>truefalse2%LOCALAPPDATA%\Programs\<app>Mapping confirmed against electron-builder upstream (
CommonWindowsInstallerConfiguration.ts:12,templates/msi/template.xml:39-44).Test plan
:example:packageMsibuilds successfully.perUserInstall = false(default): MSI inspected viaWindowsInstaller.InstallerCOM →ALLUSERS=1. Installed → app lands inC:\Program Files\NucleusDemo.perUserInstall = true: MSI rebuilt and inspected →ALLUSERS=2,MSIINSTALLPERUSER=1. Installed → app lands inC:\Users\<user>\AppData\Local\Programs\NucleusDemo.UpgradeCodecorrectly carried through fromwindows.upgradeUuidin both runs.Closes #222