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 813350414..42b1d124d 100644 Binary files a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi and b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi differ