From 0a6a8d5635dc98ac5e940d7edec3886238a5c38e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 19 Mar 2026 22:07:52 +0000
Subject: [PATCH] feat: enable per-user MSI installation for PowerShell
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Remove InstallScope="perMachine" from Package; add ALLUSERS property
(default "1" = per-machine, set ALLUSERS="" for per-user install)
- Default INSTALLFOLDER to [LocalAppDataFolder]PowerShell for per-user
- Change all PREVIOUS_* RegistrySearch Root HKLM→HKMU so saved settings
are read from the right hive on upgrade
- Change SaveInstallerProperties Root HKLM→HKMU for same reason
- Add AND ALLUSERS="1" to custom actions (RegisterManifest,
EnablePSRemoting, EnableMU) so they are skipped for per-user installs
- Split Telemetry/DisableTelemetry/SetPath into machine (System="yes",
HKLM, ALLUSERS="1") and user (System="no", HKCU, ALLUSERS="") variants
- Add ALLUSERS="1" condition to MURegistryEntries, RegistryEntries, AppPath
- Add RegistryEntriesPerUser (HKCU) so per-user installs are detectable
- Add new per-user component refs to Feature element
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
---
assets/wix/Product.wxs | 97 +++++++++++++++++++++++++++++++-----------
1 file changed, 72 insertions(+), 25 deletions(-)
diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs
index 0b525288ae..0a25cb3194 100644
--- a/assets/wix/Product.wxs
+++ b/assets/wix/Product.wxs
@@ -58,7 +58,9 @@
Manufacturer="Microsoft Corporation"
UpgradeCode="$(var.UpgradeCode)">
-
+
+
+
@@ -111,15 +113,19 @@
-
+
not INSTALLFOLDER and PREVIOUS_INSTALLFOLDER
+
+
+ ALLUSERS="" AND NOT INSTALLFOLDER
+
-
+
not ADD_PATH and PREVIOUS_ADD_PATH
@@ -136,7 +142,7 @@
-
+
not REGISTER_MANIFEST and PREVIOUS_REGISTER_MANIFEST
@@ -153,7 +159,7 @@
-
+
not ENABLE_PSREMOTING and PREVIOUS_ENABLE_PSREMOTING
@@ -167,7 +173,7 @@
-
+
not DISABLE_TELEMETRY and PREVIOUS_DISABLE_TELEMETRY
@@ -181,7 +187,7 @@