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 @@ - + not ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL and PREVIOUS_ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL @@ -195,7 +201,7 @@ - + not ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL and PREVIOUS_ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL @@ -209,7 +215,7 @@ - + not USE_MU and PREVIOUS_USE_MU @@ -226,7 +232,7 @@ - + not ENABLE_MU and PREVIOUS_ENABLE_MU @@ -277,13 +283,13 @@ Installed AND NOT UPGRADINGPRODUCTCODE - + - + - + @@ -332,12 +338,16 @@ + + + + @@ -374,16 +384,25 @@ + + ALLUSERS="1" + + + ALLUSERS="" + + - USE_MU=1 + USE_MU=1 AND ALLUSERS="1" + + ALLUSERS="1" @@ -392,10 +411,22 @@ + + + + ALLUSERS="" + + + + + + + + ALLUSERS="1" @@ -403,18 +434,33 @@ - DISABLE_TELEMETRY=1 + + DISABLE_TELEMETRY=1 AND ALLUSERS="1" + + + DISABLE_TELEMETRY=1 AND ALLUSERS="" + + + - ADD_PATH=1 + ADD_PATH=1 AND ALLUSERS="1" + + + ADD_PATH=1 AND ALLUSERS="" + + + + + @@ -479,15 +525,16 @@ - - - - - - - - - + + + + + + + + + +