From 4dcde245aee72f7bb52af4525e7e8d23cb7135e7 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 13 Aug 2025 22:57:52 -0400 Subject: [PATCH] Decompile Scope=perUserOrMachine. Fixes https://github.com/wixtoolset/issues/issues/9144 --- .../Decompile/Decompiler.cs | 8 ++++++++ .../DecompileNullComponent/Expected.wxs | 2 +- .../DecompileNullComponent/example.msi | Bin 32768 -> 32768 bytes 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 9cc3d88ed..90b07776b 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs @@ -3051,10 +3051,18 @@ private void FinalizeSummaryInformationStream(TableIndexedCollection tables) else { var xAllUsers = this.DecompilerHelper.RootElement.Elements(Names.PropertyElement).SingleOrDefault(p => p.Attribute("Id")?.Value == "ALLUSERS"); + var xMsiInstallerPerUser = this.DecompilerHelper.RootElement.Elements(Names.PropertyElement).SingleOrDefault(p => p.Attribute("Id")?.Value == "MSIINSTALLPERUSER"); if (xAllUsers?.Attribute("Value")?.Value == "1") { xAllUsers?.Remove(); } + else if (xAllUsers?.Attribute("Value")?.Value == "2" && xMsiInstallerPerUser?.Attribute("Value")?.Value == "1") + { + this.DecompilerHelper.RootElement.SetAttributeValue("Scope", "perUserOrMachine"); + + xAllUsers?.Remove(); + xMsiInstallerPerUser?.Remove(); + } } } diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs index 3d15dd3e9..1f0dea362 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs @@ -1,5 +1,5 @@ - + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi index 81335041491df94698631f44b7ce02758388ef5a..42b1d124d015498641728123dcbdd28b91f61285 100644 GIT binary patch delta 387 zcmZo@U}|V!+Tf$W$TitlL4i$Z-_oNzcP1Ar1Wa~TG-P#TU|>+0{8QmP2P2U69|$Hh zGO29-qIjMOBtQ9!ivQ%p3Wl3YR0EiKM1e|Jkd!U{qQS^$KKZMrA6Tsb6DuS0fxZ8D3&6^?&ED=k2r2L=k0RSX0+3mAUjQ-1lE zfq@YSSs9qXG*AHp2N1F{Fat@DW`@nl4tE(RA8>Zq?BLYEIN8D1VUvpk=i~<88fHNT z#?AkI8JQ*(ILH`*`Yv!>3{!Zg#xL`dIfBnOsy=9ERF08oDAFyybSydf(*h8q73_i jZsB6!Vc=sBU=RZOSd4*rb8^8{CUyl#IB))6#K;Q()VytW delta 360 zcmZo@U}|V!+Tf$W$T-yg8CrCdVNZT$6ppjmiU9|VGu>1pAz+!NP!yG69<~%S^U~vR;HnSN1 z;ge@);AG%t;AP-v5M&SrI*EgUi-CuMk3oPzh(Uxw3}}#|^2@(K