diff options
Diffstat (limited to 'src/test')
8 files changed, 71 insertions, 7 deletions
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.ico b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.ico new file mode 100644 index 00000000..53134de7 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.ico | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs index 5319d2f7..2a1b4347 100644 --- a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs | |||
@@ -1,9 +1,10 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> |
2 | <Fragment> | 2 | <Fragment> |
3 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | 3 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> |
4 | <Component> | 4 | <Component> |
5 | <File Source="example.txt" /> | 5 | <File Id="Package.ico" Source="Package.ico" /> |
6 | <util:InternetShortcut Id="wixshortcut" Name="WiX Toolset" Target="https://wixtoolset.org" /> | 6 | <util:InternetShortcut Type="link" Name="WiX Toolset (link)" Target="https://wixtoolset.org" IconFile="[#Package.ico]" /> |
7 | <util:InternetShortcut Type="url" Name="WiX Toolset (url)" Target="https://wixtoolset.org" IconFile="[#Package.ico]" /> | ||
7 | </Component> | 8 | </Component> |
8 | </ComponentGroup> | 9 | </ComponentGroup> |
9 | </Fragment> | 10 | </Fragment> |
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.en-us.wxl | |||
@@ -0,0 +1,11 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | |||
3 | <!-- | ||
4 | This file contains the declaration of all the localizable strings. | ||
5 | --> | ||
6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
7 | |||
8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
9 | <String Id="FeatureTitle">MsiPackage</String> | ||
10 | |||
11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.ico b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.ico new file mode 100644 index 00000000..53134de7 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.ico | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.wxs new file mode 100644 index 00000000..f38295e7 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/Package.wxs | |||
@@ -0,0 +1,15 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
2 | <Module Language="1033" Version="1.0.0.0" Id="InternetShortcutModule"> | ||
3 | <Package Id="047730a5-30fe-4a62-a520-da9381b8226a" Manufacturer="Example Corporation" /> | ||
4 | |||
5 | <ComponentGroupRef Id="ProductComponents" /> | ||
6 | </Module> | ||
7 | |||
8 | <Fragment> | ||
9 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
10 | <Directory Id="ProgramFilesFolder"> | ||
11 | <Directory Id="INSTALLFOLDER" Name="MergeModule" /> | ||
12 | </Directory> | ||
13 | </Directory> | ||
14 | </Fragment> | ||
15 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/PackageComponents.wxs new file mode 100644 index 00000000..2a1b4347 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcutModule/PackageComponents.wxs | |||
@@ -0,0 +1,11 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
2 | <Fragment> | ||
3 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
4 | <Component> | ||
5 | <File Id="Package.ico" Source="Package.ico" /> | ||
6 | <util:InternetShortcut Type="link" Name="WiX Toolset (link)" Target="https://wixtoolset.org" IconFile="[#Package.ico]" /> | ||
7 | <util:InternetShortcut Type="url" Name="WiX Toolset (url)" Target="https://wixtoolset.org" IconFile="[#Package.ico]" /> | ||
8 | </Component> | ||
9 | </ComponentGroup> | ||
10 | </Fragment> | ||
11 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 101d71e8..a32a7d62 100644 --- a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -73,7 +73,7 @@ namespace WixToolsetTest.Util | |||
73 | } | 73 | } |
74 | 74 | ||
75 | [Fact] | 75 | [Fact] |
76 | public void CanBuildInternetShortcut() | 76 | public void CanBuildInternetShortcutInProduct() |
77 | { | 77 | { |
78 | var folder = TestData.Get(@"TestData\InternetShortcut"); | 78 | var folder = TestData.Get(@"TestData\InternetShortcut"); |
79 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | 79 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); |
@@ -85,8 +85,30 @@ namespace WixToolsetTest.Util | |||
85 | "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t", | 85 | "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t", |
86 | "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t", | 86 | "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t", |
87 | "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64\tWixSchedInternetShortcuts\t", | 87 | "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64\tWixSchedInternetShortcuts\t", |
88 | "RemoveFile:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tzf9nskwi.lnk|WiX Toolset.lnk\tINSTALLFOLDER\t2", | 88 | "RemoveFile:uisdCsU32.1i4Hebrg1N7E194zJQ8Y\tPackage.ico\thoiptxrr.url|WiX Toolset (url).url\tINSTALLFOLDER\t2", |
89 | "Wix4InternetShortcut:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tINSTALLFOLDER\tWiX Toolset.lnk\thttps://wixtoolset.org\t0\t\t0", | 89 | "RemoveFile:uisjV.q0ROZZYR3h_lkpbkZtLtPH0A\tPackage.ico\tjcxd1dwf.lnk|WiX Toolset (link).lnk\tINSTALLFOLDER\t2", |
90 | "Wix4InternetShortcut:uisdCsU32.1i4Hebrg1N7E194zJQ8Y\tPackage.ico\tINSTALLFOLDER\tWiX Toolset (url).url\thttps://wixtoolset.org\t1\t[#Package.ico]\t0", | ||
91 | "Wix4InternetShortcut:uisjV.q0ROZZYR3h_lkpbkZtLtPH0A\tPackage.ico\tINSTALLFOLDER\tWiX Toolset (link).lnk\thttps://wixtoolset.org\t0\t[#Package.ico]\t0", | ||
92 | }, results.OrderBy(s => s).ToArray()); | ||
93 | } | ||
94 | |||
95 | [Fact] | ||
96 | public void CanBuildInternetShortcutInMergeModule() | ||
97 | { | ||
98 | var folder = TestData.Get(@"TestData\InternetShortcutModule"); | ||
99 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
100 | |||
101 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveFile", "Wix4InternetShortcut"); | ||
102 | WixAssert.CompareLineByLine(new[] | ||
103 | { | ||
104 | "Binary:Wix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t[Binary data]", | ||
105 | "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\tWixCreateInternetShortcuts\t", | ||
106 | "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\tWixRollbackInternetShortcuts\t", | ||
107 | "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\tWixSchedInternetShortcuts\t", | ||
108 | "RemoveFile:uisdCsU32.1i4Hebrg1N7E194zJQ8Y.047730A5_30FE_4A62_A520_DA9381B8226A\tPackage.ico.047730A5_30FE_4A62_A520_DA9381B8226A\thoiptxrr.url|WiX Toolset (url).url\tINSTALLFOLDER.047730A5_30FE_4A62_A520_DA9381B8226A\t2", | ||
109 | "RemoveFile:uisjV.q0ROZZYR3h_lkpbkZtLtPH0A.047730A5_30FE_4A62_A520_DA9381B8226A\tPackage.ico.047730A5_30FE_4A62_A520_DA9381B8226A\tjcxd1dwf.lnk|WiX Toolset (link).lnk\tINSTALLFOLDER.047730A5_30FE_4A62_A520_DA9381B8226A\t2", | ||
110 | "Wix4InternetShortcut:uisdCsU32.1i4Hebrg1N7E194zJQ8Y.047730A5_30FE_4A62_A520_DA9381B8226A\tPackage.ico.047730A5_30FE_4A62_A520_DA9381B8226A\tINSTALLFOLDER.047730A5_30FE_4A62_A520_DA9381B8226A\tWiX Toolset (url).url\thttps://wixtoolset.org\t1\t[#Package.ico.047730A5_30FE_4A62_A520_DA9381B8226A]\t0", | ||
111 | "Wix4InternetShortcut:uisjV.q0ROZZYR3h_lkpbkZtLtPH0A.047730A5_30FE_4A62_A520_DA9381B8226A\tPackage.ico.047730A5_30FE_4A62_A520_DA9381B8226A\tINSTALLFOLDER.047730A5_30FE_4A62_A520_DA9381B8226A\tWiX Toolset (link).lnk\thttps://wixtoolset.org\t0\t[#Package.ico.047730A5_30FE_4A62_A520_DA9381B8226A]\t0", | ||
90 | }, results.OrderBy(s => s).ToArray()); | 112 | }, results.OrderBy(s => s).ToArray()); |
91 | } | 113 | } |
92 | 114 | ||
diff --git a/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj index f2d5c486..50776c2c 100644 --- a/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj +++ b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj | |||
@@ -27,10 +27,14 @@ | |||
27 | <Content Include="TestData\CloseApplication\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 27 | <Content Include="TestData\CloseApplication\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
28 | <Content Include="TestData\CloseApplication\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 28 | <Content Include="TestData\CloseApplication\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
29 | <Content Include="TestData\CloseApplication\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 29 | <Content Include="TestData\CloseApplication\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
30 | <Content Include="TestData\InternetShortcut\example.txt" CopyToOutputDirectory="PreserveNewest" /> | 30 | <Content Include="TestData\InternetShortcut\Package.ico" CopyToOutputDirectory="PreserveNewest" /> |
31 | <Content Include="TestData\InternetShortcut\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 31 | <Content Include="TestData\InternetShortcut\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
32 | <Content Include="TestData\InternetShortcut\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 32 | <Content Include="TestData\InternetShortcut\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
33 | <Content Include="TestData\InternetShortcut\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 33 | <Content Include="TestData\InternetShortcut\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
34 | <Content Include="TestData\InternetShortcutModule\Package.ico" CopyToOutputDirectory="PreserveNewest" /> | ||
35 | <Content Include="TestData\InternetShortcutModule\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
36 | <Content Include="TestData\InternetShortcutModule\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
37 | <Content Include="TestData\InternetShortcutModule\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
34 | <Content Include="TestData\PermissionEx\example.txt" CopyToOutputDirectory="PreserveNewest" /> | 38 | <Content Include="TestData\PermissionEx\example.txt" CopyToOutputDirectory="PreserveNewest" /> |
35 | <Content Include="TestData\PermissionEx\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 39 | <Content Include="TestData\PermissionEx\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
36 | <Content Include="TestData\PermissionEx\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 40 | <Content Include="TestData\PermissionEx\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |