diff options
| author | Bob Arnson <bob@firegiant.com> | 2025-08-13 22:57:52 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2025-08-13 22:57:52 -0400 |
| commit | 4dcde245aee72f7bb52af4525e7e8d23cb7135e7 (patch) | |
| tree | 5cdfc0361b3077192ee3035d096fd0fff6517236 | |
| parent | c1b3fba6e6a5badb1b7f007e9c85874694d90384 (diff) | |
| download | wix-bob/DecompilePerUserOrMachine.tar.gz wix-bob/DecompilePerUserOrMachine.tar.bz2 wix-bob/DecompilePerUserOrMachine.zip | |
Decompile Scope=perUserOrMachine.bob/DecompilePerUserOrMachine
Fixes https://github.com/wixtoolset/issues/issues/9144
3 files changed, 9 insertions, 1 deletions
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 9cc3d88e..90b07776 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs | |||
| @@ -3051,10 +3051,18 @@ namespace WixToolset.Core.WindowsInstaller.Decompile | |||
| 3051 | else | 3051 | else |
| 3052 | { | 3052 | { |
| 3053 | var xAllUsers = this.DecompilerHelper.RootElement.Elements(Names.PropertyElement).SingleOrDefault(p => p.Attribute("Id")?.Value == "ALLUSERS"); | 3053 | var xAllUsers = this.DecompilerHelper.RootElement.Elements(Names.PropertyElement).SingleOrDefault(p => p.Attribute("Id")?.Value == "ALLUSERS"); |
| 3054 | var xMsiInstallerPerUser = this.DecompilerHelper.RootElement.Elements(Names.PropertyElement).SingleOrDefault(p => p.Attribute("Id")?.Value == "MSIINSTALLPERUSER"); | ||
| 3054 | if (xAllUsers?.Attribute("Value")?.Value == "1") | 3055 | if (xAllUsers?.Attribute("Value")?.Value == "1") |
| 3055 | { | 3056 | { |
| 3056 | xAllUsers?.Remove(); | 3057 | xAllUsers?.Remove(); |
| 3057 | } | 3058 | } |
| 3059 | else if (xAllUsers?.Attribute("Value")?.Value == "2" && xMsiInstallerPerUser?.Attribute("Value")?.Value == "1") | ||
| 3060 | { | ||
| 3061 | this.DecompilerHelper.RootElement.SetAttributeValue("Scope", "perUserOrMachine"); | ||
| 3062 | |||
| 3063 | xAllUsers?.Remove(); | ||
| 3064 | xMsiInstallerPerUser?.Remove(); | ||
| 3065 | } | ||
| 3058 | } | 3066 | } |
| 3059 | } | 3067 | } |
| 3060 | 3068 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs index 3d15dd3e..1f0dea36 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 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 2 | <Package Codepage="65001" Language="1033" Manufacturer="Example Corporation" Name="MsiPackage" UpgradeCode="{047730A5-30FE-4A62-A520-DA9381B8226A}" Version="1.0.0.0" InstallerVersion="200" ProductCode="{6F9B5694-F0F1-437C-919B-0D2DAF2D9DEA}"> | 2 | <Package Codepage="65001" Language="1033" Manufacturer="Example Corporation" Name="MsiPackage" UpgradeCode="{047730A5-30FE-4A62-A520-DA9381B8226A}" Version="1.0.0.0" InstallerVersion="200" ProductCode="{6F9B5694-F0F1-437C-919B-0D2DAF2D9DEA}" Scope="perUserOrMachine"> |
| 3 | <StandardDirectory Id="ProgramFilesFolder"> | 3 | <StandardDirectory Id="ProgramFilesFolder"> |
| 4 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="oekcr5lq"> | 4 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="oekcr5lq"> |
| 5 | <Component Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Guid="" Bitness="always32"> | 5 | <Component Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Guid="" Bitness="always32"> |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi index 81335041..42b1d124 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi | |||
| Binary files differ | |||
