diff options
author | Bob Arnson <bob@firegiant.com> | 2020-12-08 14:00:13 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-12-08 14:42:14 -0500 |
commit | 8a67cff70cdfa014cc068dcc7756ed57b2ed1642 (patch) | |
tree | 97a434f6ea1d6fa829a7d5aee905eb3624ddaa04 | |
parent | 5a874790ba9ec6c2d3c9002699114c2fe4c493ae (diff) | |
download | wix-8a67cff70cdfa014cc068dcc7756ed57b2ed1642.tar.gz wix-8a67cff70cdfa014cc068dcc7756ed57b2ed1642.tar.bz2 wix-8a67cff70cdfa014cc068dcc7756ed57b2ed1642.zip |
Decompiling null GUID should set `Guid=""` to match.
6 files changed, 28 insertions, 1 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 80ee75a5..d11a890c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs | |||
@@ -4152,7 +4152,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
4152 | { | 4152 | { |
4153 | var xComponent = new XElement(Names.ComponentElement, | 4153 | var xComponent = new XElement(Names.ComponentElement, |
4154 | new XAttribute("Id", row.FieldAsString(0)), | 4154 | new XAttribute("Id", row.FieldAsString(0)), |
4155 | row.IsColumnEmpty(1) ? null : new XAttribute("Guid", row.FieldAsString(1))); | 4155 | new XAttribute("Guid", row.FieldAsString(1) ?? String.Empty)); |
4156 | 4156 | ||
4157 | var attributes = row.FieldAsInteger(3); | 4157 | var attributes = row.FieldAsInteger(3); |
4158 | 4158 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index 15082f2b..b07f5bda 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs | |||
@@ -72,5 +72,11 @@ namespace WixToolsetTest.CoreIntegration | |||
72 | { | 72 | { |
73 | DecompileAndCompare(@"TestData\Shortcut", "shortcuts.msi", "DecompiledShortcuts.wxs"); | 73 | DecompileAndCompare(@"TestData\Shortcut", "shortcuts.msi", "DecompiledShortcuts.wxs"); |
74 | } | 74 | } |
75 | |||
76 | [Fact] | ||
77 | public void CanDecompileNullComponent() | ||
78 | { | ||
79 | DecompileAndCompare(@"TestData\DecompileNullComponent", "example.msi", "Expected.wxs"); | ||
80 | } | ||
75 | } | 81 | } |
76 | } | 82 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs new file mode 100644 index 00000000..89592150 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs | |||
@@ -0,0 +1,18 @@ | |||
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" Compressed="yes" InstallerVersion="200" ProductCode="{6F9B5694-F0F1-437C-919B-0D2DAF2D9DEA}"> | ||
3 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
4 | <Directory Id="ProgramFilesFolder"> | ||
5 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="oekcr5lq"> | ||
6 | <Component Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Guid="" Win64="no"> | ||
7 | <File Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" Name="test.txt" KeyPath="yes" Source="SourceDir\File\filcV1yrx0x8wJWj4qMzcH21jwkPko" /> | ||
8 | </Component> | ||
9 | </Directory> | ||
10 | </Directory> | ||
11 | </Directory> | ||
12 | <Feature Id="ProductFeature" Level="1" Title="MsiPackage"> | ||
13 | <ComponentRef Id="filcV1yrx0x8wJWj4qMzcH21jwkPko" /> | ||
14 | </Feature> | ||
15 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
16 | <Media Id="1" Cabinet="example.cab" /> | ||
17 | </Package> | ||
18 | </Wix> \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.cab b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.cab new file mode 100644 index 00000000..125eeb2c --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.cab | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi new file mode 100644 index 00000000..81335041 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/example.msi | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 8e5a005c..6c494169 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -207,6 +207,9 @@ | |||
207 | <Content Include="TestData\WixlibWithBinaries\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 207 | <Content Include="TestData\WixlibWithBinaries\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
208 | <Content Include="TestData\WixlibWithBinaries\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 208 | <Content Include="TestData\WixlibWithBinaries\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
209 | <Content Include="TestData\WixlibWithBinaries\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 209 | <Content Include="TestData\WixlibWithBinaries\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
210 | <Content Include="TestData\DecompileNullComponent\example.cab" CopyToOutputDirectory="PreserveNewest" /> | ||
211 | <Content Include="TestData\DecompileNullComponent\example.msi" CopyToOutputDirectory="PreserveNewest" /> | ||
212 | <Content Include="TestData\DecompileNullComponent\Expected.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
210 | </ItemGroup> | 213 | </ItemGroup> |
211 | 214 | ||
212 | <ItemGroup> | 215 | <ItemGroup> |