aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-11-08 13:37:15 +1000
committerSean Hall <r.sean.hall@gmail.com>2019-11-08 14:53:03 +1000
commite03595bdca426a03ad740e4c312f028f97f465ec (patch)
tree2a433cc6defe72a2af8d33dc9596a986147d7174 /src
parent62c2eaf958c0b1a410fdf91dd0edcb542c60ef07 (diff)
downloadwix-e03595bdca426a03ad740e4c312f028f97f465ec.tar.gz
wix-e03595bdca426a03ad740e4c312f028f97f465ec.tar.bz2
wix-e03595bdca426a03ad740e4c312f028f97f465ec.zip
Add failing test for decompiling a non-advertised shortcut with complex Target.
Diffstat (limited to 'src')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs28
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs24
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msibin0 -> 32768 bytes
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj2
4 files changed, 54 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
index bace97b3..d6cf4742 100644
--- a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
@@ -96,5 +96,33 @@ namespace WixToolsetTest.CoreIntegration
96 Assert.Equal(expected, actualFormatted); 96 Assert.Equal(expected, actualFormatted);
97 } 97 }
98 } 98 }
99
100 [Fact(Skip = "Test demonstrates failure")]
101 public void CanDecompileShortcuts()
102 {
103 var folder = TestData.Get(@"TestData\Shortcut");
104
105 using (var fs = new DisposableFileSystem())
106 {
107 var intermediateFolder = fs.GetFolder();
108 var outputPath = Path.Combine(intermediateFolder, @"Actual.wxs");
109
110 var result = WixRunner.Execute(new[]
111 {
112 "decompile",
113 Path.Combine(folder, "shortcuts.msi"),
114 "-intermediateFolder", intermediateFolder,
115 "-o", outputPath
116 });
117
118 result.AssertSuccess();
119
120 var actual = File.ReadAllText(outputPath);
121 var actualFormatted = XDocument.Parse(actual, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString();
122 var expected = XDocument.Load(Path.Combine(folder, "DecompiledShortcuts.wxs"), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString();
123
124 Assert.Equal(expected, actualFormatted);
125 }
126 }
99 } 127 }
100} 128}
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs
new file mode 100644
index 00000000..3a9e401c
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs
@@ -0,0 +1,24 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Product Id="{6CA94D1D-B568-4ED6-9EBC-3534C85970BB}" Codepage="1252" Language="1033" Manufacturer="Example Corporation" Name="MsiPackage" UpgradeCode="{12E4699F-E774-4D05-8A01-5BDD41BBA127}" Version="1.0.0.0">
4 <Package Description="MsiPackage" InstallerVersion="500" Languages="1033" Manufacturer="Example Corporation" Platform="x86" />
5 <Directory Id="TARGETDIR" Name="SourceDir">
6 <Directory Id="ProgramFilesFolder">
7 <Directory Id="INSTALLFOLDER" Name="MsiPackage" ShortName="ykd0udtb">
8 <Component Id="ShortcutComp" Guid="{5B3B3FC1-533D-4C29-BFB3-0E88B51E59D8}" Win64="no">
9 <File Id="test.txt" Name="test.txt" KeyPath="yes" Source="SourceDir\\MsiPackage\test.txt" />
10 <Shortcut Id="FileTargetShortcut" Directory="INSTALLFOLDER" Name="FileTargetShortcut" ShortName="lm2tdtqp" Target="[#test.txt]" />
11 <Shortcut Id="CustomTargetShortcut" Directory="INSTALLFOLDER" Name="CustomTargetShortcut" ShortName="treusbt_" Target="[INSTALLFOLDER]custom.target" />
12 <Shortcut Id="AdvtShortcut" Directory="INSTALLFOLDER" Name="AdvtShortcut" ShortName="mdbqel9r" Advertise="yes" />
13 </Component>
14 </Directory>
15 </Directory>
16 </Directory>
17 <Feature Id="ProductFeature" Level="1" Title="MsiPackageTitle">
18 <ComponentRef Id="ShortcutComp" Primary="yes" />
19 </Feature>
20 <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
21 <Media Id="1" />
22 <Property Id="ALLUSERS" Value="1" />
23 </Product>
24</Wix> \ No newline at end of file
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi
new file mode 100644
index 00000000..3a24d1a8
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi
Binary files differ
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index b0e0d855..b0139b91 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -48,7 +48,9 @@
48 <Content Include="TestData\Registry\RemoveRegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" /> 48 <Content Include="TestData\Registry\RemoveRegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
49 <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" /> 49 <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" />
50 <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" /> 50 <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" />
51 <Content Include="TestData\Shortcut\DecompiledShortcuts.wxs" CopyToOutputDirectory="PreserveNewest" />
51 <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" /> 52 <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" />
53 <Content Include="TestData\Shortcut\shortcuts.msi" CopyToOutputDirectory="PreserveNewest" />
52 <Content Include="TestData\SimpleBundle\data\fakeba.dll" CopyToOutputDirectory="PreserveNewest" /> 54 <Content Include="TestData\SimpleBundle\data\fakeba.dll" CopyToOutputDirectory="PreserveNewest" />
53 <Content Include="TestData\SimpleBundle\data\MsiPackage\Shared.dll" CopyToOutputDirectory="PreserveNewest" /> 55 <Content Include="TestData\SimpleBundle\data\MsiPackage\Shared.dll" CopyToOutputDirectory="PreserveNewest" />
54 <Content Include="TestData\SimpleBundle\data\MsiPackage\test.txt" CopyToOutputDirectory="PreserveNewest" /> 56 <Content Include="TestData\SimpleBundle\data\MsiPackage\test.txt" CopyToOutputDirectory="PreserveNewest" />