aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-07-01 10:29:44 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-07-01 13:35:49 -0500
commit4d896b683e3d490e03f8cd10276b32e1f461699e (patch)
tree8d5b3caff91b5c1752de5ddf4c706b22e0996066
parentc3512cbeb0eb256e99b1942b62353a3d5528dfd9 (diff)
downloadwix-4d896b683e3d490e03f8cd10276b32e1f461699e.tar.gz
wix-4d896b683e3d490e03f8cd10276b32e1f461699e.tar.bz2
wix-4d896b683e3d490e03f8cd10276b32e1f461699e.zip
Some test improvements.
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs40
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs31
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs15
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs5
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs5
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs45
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithInvalidLocValues.wxs3
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithReservedVariableNames.wxs7
8 files changed, 114 insertions, 37 deletions
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs
index 815c5ccd..4d308fa5 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs
@@ -163,17 +163,15 @@ namespace WixToolsetTest.CoreIntegration
163 { 163 {
164 var baseFolder = fs.GetFolder(); 164 var baseFolder = fs.GetFolder();
165 var intermediateFolder = Path.Combine(baseFolder, "obj"); 165 var intermediateFolder = Path.Combine(baseFolder, "obj");
166 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
166 167
167 var result = WixRunner.Execute(new[] 168 var result = WixRunner.Execute(new[]
168 { 169 {
169 "build", 170 "build",
170 Path.Combine(folder, "BundleWithInvalid", "BundleWithInvalidLocVariableNames.wxs"), 171 Path.Combine(folder, "BundleWithInvalid", "BundleWithInvalidLocVariableNames.wxs"),
171 "-loc", Path.Combine(folder, "BundleWithInvalid", "BundleWithInvalidLocValues.wxl"), 172 "-loc", Path.Combine(folder, "BundleWithInvalid", "BundleWithInvalidLocValues.wxl"),
172 "-bindpath", Path.Combine(folder, ".Data"),
173 "-bindpath", Path.Combine(folder, "DecompileSingleFileCompressed"),
174 "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
175 "-intermediateFolder", intermediateFolder, 173 "-intermediateFolder", intermediateFolder,
176 "-o", Path.Combine(baseFolder, @"bin\test.exe") 174 "-o", wixlibPath,
177 }); 175 });
178 176
179 var messages = result.Messages.Select(m => m.ToString()).ToList(); 177 var messages = result.Messages.Select(m => m.ToString()).ToList();
@@ -191,6 +189,39 @@ namespace WixToolsetTest.CoreIntegration
191 } 189 }
192 190
193 [Fact] 191 [Fact]
192 public void CannotBuildBundleWithReservedVariableNames()
193 {
194 var folder = TestData.Get(@"TestData");
195
196 using (var fs = new DisposableFileSystem())
197 {
198 var baseFolder = fs.GetFolder();
199 var intermediateFolder = Path.Combine(baseFolder, "obj");
200 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
201
202 var result = WixRunner.Execute(new[]
203 {
204 "build",
205 Path.Combine(folder, "BundleWithInvalid", "BundleWithReservedVariableNames.wxs"),
206 "-intermediateFolder", intermediateFolder,
207 "-o", wixlibPath,
208 });
209
210 var messages = result.Messages.Select(m => m.ToString()).ToList();
211 messages.Sort();
212
213 WixAssert.CompareLineByLine(new[]
214 {
215 "The SetVariable/@Variable attribute's value, 'WixBundleInstalled', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFiles64Folder', 'CommonFilesFolder', 'CompatibilityMode', 'Date', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'InstallerName', 'InstallerVersion', 'LocalAppDataFolder', 'LogonUser', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFiles64Folder', 'ProgramFiles6432Folder', 'ProgramFilesFolder', 'ProgramMenuFolder', 'RebootPending', 'SendToFolder', 'ServicePackLevel', 'StartMenuFolder', 'StartupFolder', 'System64Folder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'TerminalServer', 'UserLanguageID', 'UserUILanguageID', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', 'WindowsVolume', 'WixBundleAction', 'WixBundleCommandLineAction', 'WixBundleForcedRestartPackage', 'WixBundleElevated', 'WixBundleInstalled', 'WixBundleProviderKey', 'WixBundleTag', or 'WixBundleVersion'.",
216 "The Variable/@Name attribute's value begins with the reserved prefix 'Wix'. Some prefixes are reserved by the Windows Installer and WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix.",
217 "The Variable/@Name attribute's value, 'AppDataFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFiles64Folder', 'CommonFilesFolder', 'CompatibilityMode', 'Date', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'InstallerName', 'InstallerVersion', 'LocalAppDataFolder', 'LogonUser', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFiles64Folder', 'ProgramFiles6432Folder', 'ProgramFilesFolder', 'ProgramMenuFolder', 'RebootPending', 'SendToFolder', 'ServicePackLevel', 'StartMenuFolder', 'StartupFolder', 'System64Folder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'TerminalServer', 'UserLanguageID', 'UserUILanguageID', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', 'WindowsVolume', 'WixBundleAction', 'WixBundleCommandLineAction', 'WixBundleForcedRestartPackage', 'WixBundleElevated', 'WixBundleInstalled', 'WixBundleProviderKey', 'WixBundleTag', or 'WixBundleVersion'.",
218 }, messages.ToArray());
219
220 Assert.Equal(348, result.ExitCode);
221 }
222 }
223
224 [Fact]
194 public void GuardsAgainstVariousBundleValuesFromLoc() 225 public void GuardsAgainstVariousBundleValuesFromLoc()
195 { 226 {
196 var folder = TestData.Get(@"TestData"); 227 var folder = TestData.Get(@"TestData");
@@ -217,6 +248,7 @@ namespace WixToolsetTest.CoreIntegration
217 248
218 WixAssert.CompareLineByLine(new[] 249 WixAssert.CompareLineByLine(new[]
219 { 250 {
251 "*Search/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.",
220 "Bundle/@Condition contains the built-in Variable 'WixBundleInstalled', which is not available when it is evaluated. (Unavailable Variables are: 'RebootPending', 'WixBundleAction', or 'WixBundleInstalled'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", 252 "Bundle/@Condition contains the built-in Variable 'WixBundleInstalled', which is not available when it is evaluated. (Unavailable Variables are: 'RebootPending', 'WixBundleAction', or 'WixBundleInstalled'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.",
221 "ExePackage/@DetectCondition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", 253 "ExePackage/@DetectCondition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.",
222 "The CommandLine/@Condition attribute's value '=' is not a valid bundle condition.", 254 "The CommandLine/@Condition attribute's value '=' is not a valid bundle condition.",
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs
index dbc4d591..7dae1ee9 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs
@@ -59,13 +59,11 @@ namespace WixToolsetTest.CoreIntegration
59 { "Payload", new List<string> { "Size", "Hash" } }, 59 { "Payload", new List<string> { "Size", "Hash" } },
60 }; 60 };
61 WixAssert.StringEqual( 61 WixAssert.StringEqual(
62 "<root>" +
63 "<BundlePackage>" + 62 "<BundlePackage>" +
64 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" + 63 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" +
65 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" + 64 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" +
66 "</BundlePackagePayload>" + 65 "</BundlePackagePayload>" +
67 "</BundlePackage>" + 66 "</BundlePackage>", xml.GetTestXml(ignoreAttributesByElementName));
68 "</root>", xml.GetFragmentTestXml(ignoreAttributesByElementName));
69 67
70 // ExternalWithoutDownloadUrl 68 // ExternalWithoutDownloadUrl
71 var externalWithoutDownloadUrlOutFile = Path.Combine(outputFolder, "externalWithoutDownloadUrl_out.xml"); 69 var externalWithoutDownloadUrlOutFile = Path.Combine(outputFolder, "externalWithoutDownloadUrl_out.xml");
@@ -83,7 +81,6 @@ namespace WixToolsetTest.CoreIntegration
83 81
84 xml = File.ReadAllText(externalWithoutDownloadUrlOutFile); 82 xml = File.ReadAllText(externalWithoutDownloadUrlOutFile);
85 WixAssert.StringEqual( 83 WixAssert.StringEqual(
86 "<root>" +
87 "<BundlePackage>" + 84 "<BundlePackage>" +
88 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" + 85 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" +
89 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" + 86 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" +
@@ -92,8 +89,7 @@ namespace WixToolsetTest.CoreIntegration
92 "<Payload Name='test.msi' Hash='*' Size='*' />" + 89 "<Payload Name='test.msi' Hash='*' Size='*' />" +
93 "<Payload Name='test.txt' Hash='*' Size='*' />" + 90 "<Payload Name='test.txt' Hash='*' Size='*' />" +
94 "<Payload Name='Shared.dll' Hash='*' Size='*' />" + 91 "<Payload Name='Shared.dll' Hash='*' Size='*' />" +
95 "</BundlePackage>" + 92 "</BundlePackage>", xml.GetTestXml(ignoreAttributesByElementName));
96 "</root>", xml.GetFragmentTestXml(ignoreAttributesByElementName));
97 93
98 // External 94 // External
99 var externalOutFile = Path.Combine(outputFolder, "external_out.xml"); 95 var externalOutFile = Path.Combine(outputFolder, "external_out.xml");
@@ -111,7 +107,6 @@ namespace WixToolsetTest.CoreIntegration
111 107
112 xml = File.ReadAllText(externalOutFile); 108 xml = File.ReadAllText(externalOutFile);
113 WixAssert.StringEqual( 109 WixAssert.StringEqual(
114 "<root>" +
115 "<BundlePackage>" + 110 "<BundlePackage>" +
116 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" + 111 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" +
117 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" + 112 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" +
@@ -121,8 +116,7 @@ namespace WixToolsetTest.CoreIntegration
121 "<Payload Name='test.msi' Hash='*' Size='*' />" + 116 "<Payload Name='test.msi' Hash='*' Size='*' />" +
122 "<Payload Name='test.txt' Hash='*' Size='*' />" + 117 "<Payload Name='test.txt' Hash='*' Size='*' />" +
123 "<Payload Name='Shared.dll' Hash='*' Size='*' />" + 118 "<Payload Name='Shared.dll' Hash='*' Size='*' />" +
124 "</BundlePackage>" + 119 "</BundlePackage>", xml.GetTestXml(ignoreAttributesByElementName));
125 "</root>", xml.GetFragmentTestXml(ignoreAttributesByElementName));
126 120
127 // All 121 // All
128 var allOutFile = Path.Combine(outputFolder, "all_out.xml"); 122 var allOutFile = Path.Combine(outputFolder, "all_out.xml");
@@ -140,7 +134,6 @@ namespace WixToolsetTest.CoreIntegration
140 134
141 xml = File.ReadAllText(allOutFile); 135 xml = File.ReadAllText(allOutFile);
142 WixAssert.StringEqual( 136 WixAssert.StringEqual(
143 "<root>" +
144 "<BundlePackage>" + 137 "<BundlePackage>" +
145 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" + 138 "<BundlePackagePayload Name='test.exe' ProductName='DiversePayloadsBundle' Description='DiversePayloadsBundle' Hash='*' Size='*' Version='1.0.0.0'>" +
146 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" + 139 "<RemoteBundle BundleId='*' DisplayName='DiversePayloadsBundle' EngineVersion='*' InstallSize='3790116' ManifestNamespace='http://wixtoolset.org/schemas/v4/2008/Burn' PerMachine='yes' ProviderKey='*' ProtocolVersion='1' Version='1.0.0.0' Win64='no' UpgradeCode='{FEF1D2B8-4737-4A2A-9F91-77F7294FB55B}' />" +
@@ -151,8 +144,7 @@ namespace WixToolsetTest.CoreIntegration
151 "<Payload Name='test.msi' Hash='*' Size='*' />" + 144 "<Payload Name='test.msi' Hash='*' Size='*' />" +
152 "<Payload Name='test.txt' Hash='*' Size='*' />" + 145 "<Payload Name='test.txt' Hash='*' Size='*' />" +
153 "<Payload Name='Shared.dll' Hash='*' Size='*' />" + 146 "<Payload Name='Shared.dll' Hash='*' Size='*' />" +
154 "</BundlePackage>" + 147 "</BundlePackage>", xml.GetTestXml(ignoreAttributesByElementName));
155 "</root>", xml.GetFragmentTestXml(ignoreAttributesByElementName));
156 } 148 }
157 } 149 }
158 150
@@ -266,6 +258,8 @@ namespace WixToolsetTest.CoreIntegration
266 var remotePayloadSourceFile = Path.Combine(outputFolder, "remotePayload.wxs"); 258 var remotePayloadSourceFile = Path.Combine(outputFolder, "remotePayload.wxs");
267 var intermediateFolder = Path.Combine(outputFolder, "obj"); 259 var intermediateFolder = Path.Combine(outputFolder, "obj");
268 var bundleFile = Path.Combine(intermediateFolder, "out.exe"); 260 var bundleFile = Path.Combine(intermediateFolder, "out.exe");
261 var baFolderPath = Path.Combine(outputFolder, "ba");
262 var extractFolderPath = Path.Combine(outputFolder, "extract");
269 263
270 var result = WixRunner.Execute(new[] 264 var result = WixRunner.Execute(new[]
271 { 265 {
@@ -313,6 +307,17 @@ namespace WixToolsetTest.CoreIntegration
313 }); 307 });
314 308
315 result.AssertSuccess(); 309 result.AssertSuccess();
310
311 var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
312 extractResult.AssertSuccess();
313
314 var msuPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsuPackage");
315 WixAssert.CompareLineByLine(new string[]
316 {
317 "<MsuPackage Id='Windows8.1_KB2937592_x86.msu' Cache='keep' CacheId='904ADEA6AB675ACE16483138BF3F5850FD56ACB6E3A1108E2BA23632620C427C' InstallSize='309544' Size='309544' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' DetectCondition='test'>" +
318 "<PayloadRef Id='Windows8.1_KB2937592_x86.msu' />" +
319 "</MsuPackage>",
320 }, msuPackages);
316 } 321 }
317 } 322 }
318 323
@@ -328,6 +333,8 @@ namespace WixToolsetTest.CoreIntegration
328 var remotePayloadSourceFile = Path.Combine(outputFolder, "remotePayload.wxs"); 333 var remotePayloadSourceFile = Path.Combine(outputFolder, "remotePayload.wxs");
329 var intermediateFolder = Path.Combine(outputFolder, "obj"); 334 var intermediateFolder = Path.Combine(outputFolder, "obj");
330 var bundleFile = Path.Combine(intermediateFolder, "out.exe"); 335 var bundleFile = Path.Combine(intermediateFolder, "out.exe");
336 var baFolderPath = Path.Combine(outputFolder, "ba");
337 var extractFolderPath = Path.Combine(outputFolder, "extract");
331 338
332 var result = WixRunner.Execute(new[] 339 var result = WixRunner.Execute(new[]
333 { 340 {
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs
index 0dba95e1..647a5386 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs
@@ -44,14 +44,10 @@ namespace WixToolsetTest.CoreIntegration
44 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); 44 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
45 extractResult.AssertSuccess(); 45 extractResult.AssertSuccess();
46 46
47 var ignoreAttributes = new Dictionary<string, List<string>> 47 var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage");
48 {
49 { "ExePackage", new List<string> { "CacheId", "Size" } },
50 };
51 var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes);
52 WixAssert.CompareLineByLine(new string[] 48 WixAssert.CompareLineByLine(new string[]
53 { 49 {
54 "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='-repair' Repairable='yes' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.0'>" + 50 "<ExePackage Id='burn.exe' Cache='keep' CacheId='F6E722518AC3AB7E31C70099368D5770788C179AA23226110DCF07319B1E1964' InstallSize='463360' Size='463360' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='-repair' Repairable='yes' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.0'>" +
55 "<PayloadRef Id='burn.exe' />" + 51 "<PayloadRef Id='burn.exe' />" +
56 "</ExePackage>", 52 "</ExePackage>",
57 }, exePackages); 53 }, exePackages);
@@ -465,9 +461,12 @@ namespace WixToolsetTest.CoreIntegration
465 "-o", Path.Combine(baseFolder, "bin", "test.exe") 461 "-o", Path.Combine(baseFolder, "bin", "test.exe")
466 }); 462 });
467 463
464 WixAssert.CompareLineByLine(new[]
465 {
466 "The ExePackage/@CacheId attribute was not found; it is required when attribute CertificatePublicKey is specified.",
467 }, result.Messages.Select(m => m.ToString()).ToArray());
468
468 Assert.Equal(10, result.ExitCode); 469 Assert.Equal(10, result.ExitCode);
469 var message = result.Messages.Single();
470 Assert.Equal("The ExePackage/@CacheId attribute was not found; it is required when attribute CertificatePublicKey is specified.", message.ToString());
471 } 470 }
472 } 471 }
473 } 472 }
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs
index 51c83618..8beb4d8d 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs
@@ -71,7 +71,10 @@ namespace WixToolsetTest.CoreIntegration
71 { 71 {
72 7503 72 7503
73 }, errors.Select(e => e.Id).ToArray()); 73 }, errors.Select(e => e.Id).ToArray());
74 Assert.Equal("Maximum depth of the Feature tree allowed in an MSI was exceeded. An MSI does not support a Feature tree with depth greater than 16. The Feature 'Depth17' is at depth 17.", errors.Single().ToString()); 74 WixAssert.CompareLineByLine(new[]
75 {
76 "Maximum depth of the Feature tree allowed in an MSI was exceeded. An MSI does not support a Feature tree with depth greater than 16. The Feature 'Depth17' is at depth 17.",
77 }, result.Messages.Select(m => m.ToString()).ToArray());
75 } 78 }
76 } 79 }
77 } 80 }
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs
index ce963df6..011dbca5 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs
@@ -41,10 +41,7 @@ namespace WixToolsetTest.CoreIntegration
41 var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); 41 var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath);
42 extractResult.AssertSuccess(); 42 extractResult.AssertSuccess();
43 43
44 var msiProperties = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:MsiProperty") 44 var msiProperties = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:MsiProperty");
45 .Cast<XmlElement>()
46 .Select(e => e.GetTestXml())
47 .ToArray();
48 WixAssert.CompareLineByLine(new[] 45 WixAssert.CompareLineByLine(new[]
49 { 46 {
50 "<MsiProperty Id='MSIFASTINSTALL' Value='7' />" 47 "<MsiProperty Id='MSIFASTINSTALL' Value='7' />"
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs
index 0ebaf868..28cb0eb5 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs
@@ -20,6 +20,10 @@ namespace WixToolsetTest.CoreIntegration
20 { 20 {
21 var baseFolder = fs.GetFolder(); 21 var baseFolder = fs.GetFolder();
22 var intermediateFolder = Path.Combine(baseFolder, "obj"); 22 var intermediateFolder = Path.Combine(baseFolder, "obj");
23 var binFolder = Path.Combine(baseFolder, "bin");
24 var bundlePath = Path.Combine(binFolder, "test.exe");
25 var baFolderPath = Path.Combine(baseFolder, "ba");
26 var extractFolderPath = Path.Combine(baseFolder, "extract");
23 27
24 var result = WixRunner.Execute(new[] 28 var result = WixRunner.Execute(new[]
25 { 29 {
@@ -28,11 +32,22 @@ namespace WixToolsetTest.CoreIntegration
28 "-bindpath", Path.Combine(folder, "data"), 32 "-bindpath", Path.Combine(folder, "data"),
29 "-bindpath", dotDatafolder, 33 "-bindpath", dotDatafolder,
30 "-intermediateFolder", intermediateFolder, 34 "-intermediateFolder", intermediateFolder,
31 "-o", Path.Combine(baseFolder, "bin", "test.exe") 35 "-o", bundlePath,
32 }); 36 });
33 37
34 result.AssertSuccess(); 38 result.AssertSuccess();
35 Assert.True(File.Exists(Path.Combine(baseFolder, "bin", "test.exe"))); 39 Assert.True(File.Exists(bundlePath));
40
41 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
42 extractResult.AssertSuccess();
43
44 var msuPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsuPackage");
45 WixAssert.CompareLineByLine(new string[]
46 {
47 "<MsuPackage Id='test.msu' Cache='keep' CacheId='B040F02D2F90E04E9AFBDC91C00CEB5DF97D48E205D96DC0A44E10AF8870794D' InstallSize='28' Size='28' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' DetectCondition='DetectedTheMsu'>" +
48 "<PayloadRef Id='test.msu' />" +
49 "</MsuPackage>",
50 }, msuPackages);
36 } 51 }
37 } 52 }
38 53
@@ -46,6 +61,10 @@ namespace WixToolsetTest.CoreIntegration
46 { 61 {
47 var baseFolder = fs.GetFolder(); 62 var baseFolder = fs.GetFolder();
48 var intermediateFolder = Path.Combine(baseFolder, "obj"); 63 var intermediateFolder = Path.Combine(baseFolder, "obj");
64 var binFolder = Path.Combine(baseFolder, "bin");
65 var bundlePath = Path.Combine(binFolder, "test.exe");
66 var baFolderPath = Path.Combine(baseFolder, "ba");
67 var extractFolderPath = Path.Combine(baseFolder, "extract");
49 68
50 var result = WixRunner.Execute(new[] 69 var result = WixRunner.Execute(new[]
51 { 70 {
@@ -54,11 +73,22 @@ namespace WixToolsetTest.CoreIntegration
54 "-bindpath", Path.Combine(folder, "data"), 73 "-bindpath", Path.Combine(folder, "data"),
55 "-bindpath", dotDatafolder, 74 "-bindpath", dotDatafolder,
56 "-intermediateFolder", intermediateFolder, 75 "-intermediateFolder", intermediateFolder,
57 "-o", Path.Combine(baseFolder, "bin", "test.exe") 76 "-o", bundlePath,
58 }); 77 });
59 78
60 result.AssertSuccess(); 79 result.AssertSuccess();
61 Assert.True(File.Exists(Path.Combine(baseFolder, "bin", "test.exe"))); 80 Assert.True(File.Exists(bundlePath));
81
82 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
83 extractResult.AssertSuccess();
84
85 var msuPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsuPackage");
86 WixAssert.CompareLineByLine(new string[]
87 {
88 "<MsuPackage Id='Windows8.1_KB2937592_x86.msu' Cache='keep' CacheId='8cf75b99-13c0-4184-82ce-dbde45dcd55a' InstallSize='309544' Size='309544' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' DetectCondition='DetectedTheMsu'>" +
89 "<PayloadRef Id='Windows8.1_KB2937592_x86.msu' />" +
90 "</MsuPackage>",
91 }, msuPackages);
62 } 92 }
63 } 93 }
64 94
@@ -83,9 +113,12 @@ namespace WixToolsetTest.CoreIntegration
83 "-o", Path.Combine(baseFolder, "bin", "test.exe") 113 "-o", Path.Combine(baseFolder, "bin", "test.exe")
84 }); 114 });
85 115
116 WixAssert.CompareLineByLine(new[]
117 {
118 "The MsuPackage/@CacheId attribute was not found; it is required when attribute CertificatePublicKey is specified.",
119 }, result.Messages.Select(m => m.ToString()).ToArray());
120
86 Assert.Equal(10, result.ExitCode); 121 Assert.Equal(10, result.ExitCode);
87 var message = result.Messages.Single();
88 Assert.Equal("The MsuPackage/@CacheId attribute was not found; it is required when attribute CertificatePublicKey is specified.", message.ToString());
89 } 122 }
90 } 123 }
91 124
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithInvalidLocValues.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithInvalidLocValues.wxs
index 00263f49..74f66bbb 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithInvalidLocValues.wxs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithInvalidLocValues.wxs
@@ -12,7 +12,6 @@
12 <CommandLine Condition="!(loc.NonsenseExecuteCondition)" /> 12 <CommandLine Condition="!(loc.NonsenseExecuteCondition)" />
13 </ExePackage> 13 </ExePackage>
14 </Chain> 14 </Chain>
15 <!--<Variable Name="FOO" Value="1" /> 15 <SetVariable Id="Builtin" Condition="!(loc.NonsenseDetectCondition)" Variable="FOO" Value="1" />
16 <SetVariable Id="Builtin" Condition="!(loc.NonsenseDetectCondition)" Variable="FOO" Value="1" />-->
17 </Bundle> 16 </Bundle>
18</Wix> 17</Wix>
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithReservedVariableNames.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithReservedVariableNames.wxs
new file mode 100644
index 00000000..af0e6625
--- /dev/null
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithInvalid/BundleWithReservedVariableNames.wxs
@@ -0,0 +1,7 @@
1<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2 <Fragment>
3 <SetVariable Id="Builtin" Variable="WixBundleInstalled" Value="1" />
4 <Variable Name="WixCustomVariable" />
5 <Variable Name="AppDataFolder" />
6 </Fragment>
7</Wix>