diff options
author | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
commit | ff659159e041bf6c083e6b7fcb9b726065a9dd73 (patch) | |
tree | ea95bf3d3e031edcee65de33b9e6954178be669c /src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |
parent | 8a8a25695351ee542f08886a9d0957c78c6af366 (diff) | |
download | wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.gz wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.bz2 wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.zip |
Move Util.wixext into ext
Diffstat (limited to 'src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs')
-rw-r--r-- | src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | 317 |
1 files changed, 317 insertions, 0 deletions
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs new file mode 100644 index 00000000..883f9794 --- /dev/null +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -0,0 +1,317 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.Util | ||
4 | { | ||
5 | using System.IO; | ||
6 | using System.Linq; | ||
7 | using WixBuildTools.TestSupport; | ||
8 | using WixToolset.Core.TestPackage; | ||
9 | using WixToolset.Data; | ||
10 | using WixToolset.Data.Symbols; | ||
11 | using WixToolset.Util; | ||
12 | using Xunit; | ||
13 | |||
14 | public class UtilExtensionFixture | ||
15 | { | ||
16 | [Fact] | ||
17 | public void CanBuildUsingFileShare() | ||
18 | { | ||
19 | var folder = TestData.Get(@"TestData\UsingFileShare"); | ||
20 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
21 | |||
22 | var results = build.BuildAndQuery(Build, "Binary", "CustomAction", "Wix4FileShare", "Wix4FileSharePermissions"); | ||
23 | WixAssert.CompareLineByLine(new[] | ||
24 | { | ||
25 | "Binary:Wix4UtilCA_X86\t[Binary data]", | ||
26 | "CustomAction:Wix4ConfigureSmbInstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbInstall\t", | ||
27 | "CustomAction:Wix4ConfigureSmbUninstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbUninstall\t", | ||
28 | "CustomAction:Wix4CreateSmb_X86\t11265\tWix4UtilCA_X86\tCreateSmb\t", | ||
29 | "CustomAction:Wix4CreateSmbRollback_X86\t11585\tWix4UtilCA_X86\tDropSmb\t", | ||
30 | "CustomAction:Wix4DropSmb_X86\t11265\tWix4UtilCA_X86\tDropSmb\t", | ||
31 | "CustomAction:Wix4DropSmbRollback_X86\t11585\tWix4UtilCA_X86\tCreateSmb\t", | ||
32 | "Wix4FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER", | ||
33 | "Wix4FileSharePermissions:ExampleFileShare\tEveryone\t1", | ||
34 | }, results.OrderBy(s => s).ToArray()); | ||
35 | } | ||
36 | |||
37 | [Fact] | ||
38 | public void CanBuildUsingFileShareX64() | ||
39 | { | ||
40 | var folder = TestData.Get(@"TestData\UsingFileShare"); | ||
41 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
42 | |||
43 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4FileShare", "Wix4FileSharePermissions"); | ||
44 | WixAssert.CompareLineByLine(new[] | ||
45 | { | ||
46 | "Binary:Wix4UtilCA_X64\t[Binary data]", | ||
47 | "CustomAction:Wix4ConfigureSmbInstall_X64\t1\tWix4UtilCA_X64\tConfigureSmbInstall\t", | ||
48 | "CustomAction:Wix4ConfigureSmbUninstall_X64\t1\tWix4UtilCA_X64\tConfigureSmbUninstall\t", | ||
49 | "CustomAction:Wix4CreateSmb_X64\t11265\tWix4UtilCA_X64\tCreateSmb\t", | ||
50 | "CustomAction:Wix4CreateSmbRollback_X64\t11585\tWix4UtilCA_X64\tDropSmb\t", | ||
51 | "CustomAction:Wix4DropSmb_X64\t11265\tWix4UtilCA_X64\tDropSmb\t", | ||
52 | "CustomAction:Wix4DropSmbRollback_X64\t11585\tWix4UtilCA_X64\tCreateSmb\t", | ||
53 | "Wix4FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER", | ||
54 | "Wix4FileSharePermissions:ExampleFileShare\tEveryone\t1", | ||
55 | }, results.OrderBy(s => s).ToArray()); | ||
56 | } | ||
57 | |||
58 | [Fact] | ||
59 | public void CanBuildCloseApplication() | ||
60 | { | ||
61 | var folder = TestData.Get(@"TestData\CloseApplication"); | ||
62 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
63 | |||
64 | var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction", "Wix4CloseApplication"); | ||
65 | WixAssert.CompareLineByLine(new[] | ||
66 | { | ||
67 | "Binary:Wix4UtilCA_A64\t[Binary data]", | ||
68 | "CustomAction:Wix4CheckRebootRequired_A64\t65\tWix4UtilCA_A64\tWixCheckRebootRequired\t", | ||
69 | "CustomAction:Wix4CloseApplications_A64\t1\tWix4UtilCA_A64\tWixCloseApplications\t", | ||
70 | "CustomAction:Wix4CloseApplicationsDeferred_A64\t3073\tWix4UtilCA_A64\tWixCloseApplicationsDeferred\t", | ||
71 | "Wix4CloseApplication:CloseMyApp\texplorer.exe\t\t\t3\t\tMYAPPISRUNNING\t\t", | ||
72 | }, results.OrderBy(s => s).ToArray()); | ||
73 | } | ||
74 | |||
75 | [Fact] | ||
76 | public void CanBuildInternetShortcutInProduct() | ||
77 | { | ||
78 | var folder = TestData.Get(@"TestData\InternetShortcut"); | ||
79 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
80 | |||
81 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveFile", "Wix4InternetShortcut"); | ||
82 | WixAssert.CompareLineByLine(new[] | ||
83 | { | ||
84 | "Binary:Wix4UtilCA_X64\t[Binary data]", | ||
85 | "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t", | ||
86 | "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t", | ||
87 | "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64\tWixSchedInternetShortcuts\t", | ||
88 | "RemoveFile:uisdCsU32.1i4Hebrg1N7E194zJQ8Y\tPackage.ico\thoiptxrr.url|WiX Toolset (url).url\tINSTALLFOLDER\t2", | ||
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 }, "test.msm"); | ||
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", | ||
112 | }, results.OrderBy(s => s).ToArray()); | ||
113 | } | ||
114 | |||
115 | [Fact] | ||
116 | public void CanBuildWithPermissionEx() | ||
117 | { | ||
118 | var folder = TestData.Get(@"TestData\PermissionEx"); | ||
119 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
120 | |||
121 | var results = build.BuildAndQuery(BuildX64, "Wix4SecureObject"); | ||
122 | WixAssert.CompareLineByLine(new[] | ||
123 | { | ||
124 | "Wix4SecureObject:ExampleRegistryKey\tRegistry\t\tEveryone\t1\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
125 | "Wix4SecureObject:filF5_pLhBuF5b4N9XEo52g_hUM5Lo\tFile\t\tEveryone\t1\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
126 | "Wix4SecureObject:INSTALLFOLDER\tCreateFolder\t\tEveryone\t1\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
127 | "Wix4SecureObject:regL6DnQ9yJpDJH5OdcVji4YXsdX2c\tRegistry\t\tEveryone\t1\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
128 | "Wix4SecureObject:testsvc\tServiceInstall\t\tEveryone\t1\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
129 | }, results.OrderBy(s => s).ToArray()); | ||
130 | } | ||
131 | |||
132 | [Fact] | ||
133 | public void CanBuildRemoveRegistryKeyExInMergeModule() | ||
134 | { | ||
135 | var folder = TestData.Get(@"TestData", "RemoveRegistryKeyEx"); | ||
136 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }, "test.msm"); | ||
137 | |||
138 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveRegistry", "Wix4RemoveRegistryKeyEx"); | ||
139 | WixAssert.CompareLineByLine(new[] | ||
140 | { | ||
141 | "Binary:Wix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t[Binary data]", | ||
142 | "CustomAction:Wix4RemoveRegistryKeysEx_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t65\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\tWixRemoveRegistryKeysEx\t", | ||
143 | "Wix4RemoveRegistryKeyEx:rrxfcDhR4HhE3v3rYiQcNtQjyahQNg.047730A5_30FE_4A62_A520_DA9381B8226A\tfilh4juyUVjoUcWWtcQmd5L07FoON4.047730A5_30FE_4A62_A520_DA9381B8226A\t2\tSOFTWARE\\Example\t1\t", | ||
144 | }, results.OrderBy(s => s).ToArray()); | ||
145 | } | ||
146 | |||
147 | [Fact] | ||
148 | public void CanBuildRemoveFolderExInMergeModule() | ||
149 | { | ||
150 | var folder = TestData.Get(@"TestData\RemoveFolderEx"); | ||
151 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }, "test.msm"); | ||
152 | |||
153 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveFile", "Wix4RemoveFolderEx"); | ||
154 | WixAssert.CompareLineByLine(new[] | ||
155 | { | ||
156 | "Binary:Wix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t[Binary data]", | ||
157 | "CustomAction:Wix4RemoveFoldersEx_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t65\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\tWixRemoveFoldersEx\t", | ||
158 | "Wix4RemoveFolderEx:wrf5qCm1SE.zp8djrlk78l1IYFXsEw.047730A5_30FE_4A62_A520_DA9381B8226A\tfilh4juyUVjoUcWWtcQmd5L07FoON4.047730A5_30FE_4A62_A520_DA9381B8226A\tRemoveProp.047730A5_30FE_4A62_A520_DA9381B8226A\t3\t", | ||
159 | }, results.OrderBy(s => s).ToArray()); | ||
160 | } | ||
161 | |||
162 | [Fact] | ||
163 | public void CanBuildWithEventManifest() | ||
164 | { | ||
165 | var folder = TestData.Get(@"TestData\EventManifest"); | ||
166 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
167 | |||
168 | var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction", "Wix4EventManifest", "Wix4XmlFile"); | ||
169 | WixAssert.CompareLineByLine(new[] | ||
170 | { | ||
171 | "Binary:Wix4UtilCA_A64\t[Binary data]", | ||
172 | "CustomAction:Wix4ConfigureEventManifestRegister_A64\t1\tWix4UtilCA_A64\tConfigureEventManifestRegister\t", | ||
173 | "CustomAction:Wix4ConfigureEventManifestUnregister_A64\t1\tWix4UtilCA_A64\tConfigureEventManifestUnregister\t", | ||
174 | "CustomAction:Wix4ExecXmlFile_A64\t11265\tWix4UtilCA_A64\tExecXmlFile\t", | ||
175 | "CustomAction:Wix4ExecXmlFileRollback_A64\t11521\tWix4UtilCA_A64\tExecXmlFileRollback\t", | ||
176 | "CustomAction:Wix4RegisterEventManifest_A64\t3073\tWix4UtilCA_A64\tWixQuietExec\t", | ||
177 | "CustomAction:Wix4RollbackRegisterEventManifest_A64\t3393\tWix4UtilCA_A64\tWixQuietExec\t", | ||
178 | "CustomAction:Wix4RollbackUnregisterEventManifest_A64\t3329\tWix4UtilCA_A64\tWixQuietExec\t", | ||
179 | "CustomAction:Wix4SchedXmlFile_A64\t1\tWix4UtilCA_A64\tSchedXmlFile\t", | ||
180 | "CustomAction:Wix4UnregisterEventManifest_A64\t3137\tWix4UtilCA_A64\tWixQuietExec\t", | ||
181 | "Wix4EventManifest:Manifest.dll\t[#Manifest.dll]", | ||
182 | "Wix4XmlFile:Config_Manifest.dllMessageFile\t[#Manifest.dll]\t/*/*/*/*[\\[]@messageFileName[\\]]\tmessageFileName\t[Manifest.dll]\t4100\tManifest.dll\t", | ||
183 | "Wix4XmlFile:Config_Manifest.dllResourceFile\t[#Manifest.dll]\t/*/*/*/*[\\[]@resourceFileName[\\]]\tresourceFileName\t[Manifest.dll]\t4100\tManifest.dll\t", | ||
184 | }, results.OrderBy(s => s).ToArray()); | ||
185 | } | ||
186 | |||
187 | [Fact] | ||
188 | public void CanBuildWithQueries() | ||
189 | { | ||
190 | var folder = TestData.Get(@"TestData\Queries"); | ||
191 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
192 | |||
193 | var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction"); | ||
194 | WixAssert.CompareLineByLine(new[] | ||
195 | { | ||
196 | "Binary:Wix4UtilCA_A64\t[Binary data]", | ||
197 | "CustomAction:Wix4BroadcastEnvironmentChange_A64\t65\tWix4UtilCA_A64\tWixBroadcastEnvironmentChange\t", | ||
198 | "CustomAction:Wix4BroadcastSettingChange_A64\t65\tWix4UtilCA_A64\tWixBroadcastSettingChange\t", | ||
199 | "CustomAction:Wix4CheckRebootRequired_A64\t65\tWix4UtilCA_A64\tWixCheckRebootRequired\t", | ||
200 | "CustomAction:Wix4QueryOsDriverInfo_A64\t257\tWix4UtilCA_A64\tWixQueryOsDriverInfo\t", | ||
201 | "CustomAction:Wix4QueryOsInfo_A64\t257\tWix4UtilCA_A64\tWixQueryOsInfo\t", | ||
202 | }, results.OrderBy(s => s).ToArray()); | ||
203 | } | ||
204 | |||
205 | [Fact] | ||
206 | public void CanBuildWithXmlConfig() | ||
207 | { | ||
208 | var folder = TestData.Get(@"TestData", "XmlConfig"); | ||
209 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
210 | |||
211 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); | ||
212 | WixAssert.CompareLineByLine(new[] | ||
213 | { | ||
214 | "Wix4XmlConfig:DelElement\t[INSTALLFOLDER]my.xml\t\t//root/sub\txxx\t\t\t289\tDel\t1", | ||
215 | }, results.OrderBy(s => s).ToArray()); | ||
216 | } | ||
217 | |||
218 | [Fact] | ||
219 | public void CanBuildModuleWithXmlConfig() | ||
220 | { | ||
221 | var folder = TestData.Get(@"TestData", "XmlConfigModule"); | ||
222 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); | ||
223 | |||
224 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); | ||
225 | WixAssert.CompareLineByLine(new[] | ||
226 | { | ||
227 | "Wix4XmlConfig:AddElement.047730A5_30FE_4A62_A520_DA9381B8226A\t[my.xml.047730A5_30FE_4A62_A520_DA9381B8226A]\t\t//root/sub\txxx\t\t\t273\tParent.047730A5_30FE_4A62_A520_DA9381B8226A\t1", | ||
228 | "Wix4XmlConfig:ChildElement.047730A5_30FE_4A62_A520_DA9381B8226A\t[my.xml.047730A5_30FE_4A62_A520_DA9381B8226A]\tAddElement.047730A5_30FE_4A62_A520_DA9381B8226A\t\txxx\t\t\t0\tChild.047730A5_30FE_4A62_A520_DA9381B8226A\t1", | ||
229 | }, results.OrderBy(s => s).ToArray()); | ||
230 | } | ||
231 | |||
232 | [Fact] | ||
233 | public void CanBuildBundleWithSearches() | ||
234 | { | ||
235 | var burnStubPath = TestData.Get(@"TestData\.Data\burn.exe"); | ||
236 | var folder = TestData.Get(@"TestData\BundleWithSearches"); | ||
237 | var rootFolder = TestData.Get(); | ||
238 | var wixext = Path.Combine(rootFolder, "WixToolset.Util.wixext.dll"); | ||
239 | |||
240 | using (var fs = new DisposableFileSystem()) | ||
241 | { | ||
242 | var baseFolder = fs.GetFolder(); | ||
243 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
244 | var bundlePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
245 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
246 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
247 | |||
248 | var result = WixRunner.Execute(new[] | ||
249 | { | ||
250 | "build", | ||
251 | Path.Combine(folder, "Bundle.wxs"), | ||
252 | "-ext", wixext, | ||
253 | "-loc", Path.Combine(folder, "Bundle.en-us.wxl"), | ||
254 | "-bindpath", Path.Combine(folder, "data"), | ||
255 | "-intermediateFolder", intermediateFolder, | ||
256 | "-o", bundlePath | ||
257 | }); | ||
258 | |||
259 | result.AssertSuccess(); | ||
260 | |||
261 | Assert.True(File.Exists(bundlePath)); | ||
262 | #if TODO | ||
263 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
264 | #endif | ||
265 | |||
266 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | ||
267 | extractResult.AssertSuccess(); | ||
268 | |||
269 | var bundleExtensionDatas = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='Wix4UtilBundleExtension_X86']"); | ||
270 | Assert.Equal(1, bundleExtensionDatas.Count); | ||
271 | Assert.Equal("<BundleExtension Id='Wix4UtilBundleExtension_X86'>" + | ||
272 | "<WixWindowsFeatureSearch Id='DetectSHA2SupportId' Type='sha2CodeSigning' />" + | ||
273 | "</BundleExtension>", bundleExtensionDatas[0].GetTestXml()); | ||
274 | |||
275 | var utilSearches = extractResult.SelectManifestNodes("/burn:BurnManifest/*[self::burn:ExtensionSearch or self::burn:FileSearch or self::burn:MsiProductSearch or self::burn:RegistrySearch]"); | ||
276 | Assert.Equal(5, utilSearches.Count); | ||
277 | Assert.Equal("<ExtensionSearch Id='DetectSHA2SupportId' Variable='IsSHA2Supported' " + | ||
278 | "ExtensionId='Wix4UtilBundleExtension_X86' />", utilSearches[0].GetTestXml()); | ||
279 | Assert.Equal("<FileSearch Id='FileSearchId' Variable='FileSearchVariable' " + | ||
280 | $@"Path='%windir%\System32\mscoree.dll' Type='exists' />", utilSearches[1].GetTestXml()); | ||
281 | Assert.Equal("<MsiProductSearch Id='ProductSearchId' Variable='ProductSearchVariable' Condition='1 & 2 < 3' " + | ||
282 | "UpgradeCode='{738D02BF-E231-4370-8209-E9FD4E1BE2A1}' Type='version' />", utilSearches[2].GetTestXml()); | ||
283 | Assert.Equal("<RegistrySearch Id='RegistrySearchId' Variable='RegistrySearchVariable' " + | ||
284 | @"Root='HKLM' Key='SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' Value='Release' Type='value' VariableType='string' />", utilSearches[3].GetTestXml()); | ||
285 | Assert.Equal("<RegistrySearch Id='RegistrySearchId64' Variable='RegistrySearchVariable64' " + | ||
286 | @"Root='HKLM' Key='SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' Value='Release' Type='value' Win64='yes' VariableType='string' />", utilSearches[4].GetTestXml()); | ||
287 | } | ||
288 | } | ||
289 | |||
290 | private static void Build(string[] args) | ||
291 | { | ||
292 | var result = WixRunner.Execute(args); | ||
293 | result.AssertSuccess(); | ||
294 | } | ||
295 | |||
296 | private static void BuildX64(string[] args) | ||
297 | { | ||
298 | var newArgs = args.ToList(); | ||
299 | newArgs.Add("-platform"); | ||
300 | newArgs.Add("x64"); | ||
301 | newArgs.Add("-sw1072"); | ||
302 | |||
303 | var result = WixRunner.Execute(newArgs.ToArray()); | ||
304 | result.AssertSuccess(); | ||
305 | } | ||
306 | |||
307 | private static void BuildARM64(string[] args) | ||
308 | { | ||
309 | var newArgs = args.ToList(); | ||
310 | newArgs.Add("-platform"); | ||
311 | newArgs.Add("arm64"); | ||
312 | |||
313 | var result = WixRunner.Execute(newArgs.ToArray()); | ||
314 | result.AssertSuccess(); | ||
315 | } | ||
316 | } | ||
317 | } | ||