aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-05-01 20:44:43 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-05-04 11:33:47 -0500
commit70f6c04122db39b5d234715c373d690f97892f8b (patch)
treeb5db48faa12017b9c807fb616aba8926fb7e7d9b /src
parent0ef54303db8ce523908af744ffc318128405bebd (diff)
downloadwix-70f6c04122db39b5d234715c373d690f97892f8b.tar.gz
wix-70f6c04122db39b5d234715c373d690f97892f8b.tar.bz2
wix-70f6c04122db39b5d234715c373d690f97892f8b.zip
Add x64 Bundle tests.
Diffstat (limited to 'src')
-rw-r--r--src/TestBA/TestBA_x64.csproj24
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wixproj19
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wxs10
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj19
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleB_x64/BundleB_x64.wixproj22
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleC/BundleC.wixproj20
-rw-r--r--src/TestData/BasicFunctionalityTests/BundleC_x64/BundleC_x64.wixproj22
-rw-r--r--src/TestData/BasicFunctionalityTests/PackageA_x64/PackageA_x64.wixproj10
-rw-r--r--src/TestData/Templates/Bundle.wxs8
-rw-r--r--src/TestData/Templates/Package.wxs2
-rw-r--r--src/TestData/TestBA/TestBAWixlib_x64/TestBA_x64.wxs30
-rw-r--r--src/TestData/TestBA/TestBAWixlib_x64/TestExe_x64.wxs9
-rw-r--r--src/TestData/TestBA/TestBAWixlib_x64/testbawixlib_x64.wixproj20
-rw-r--r--src/TestExe/TestExe_x64.csproj17
-rw-r--r--src/WixTestTools/BundleRegistration.cs5
-rw-r--r--src/WixTestTools/BundleVerifier.cs11
-rw-r--r--src/WixTestTools/PackageInstaller.cs14
-rw-r--r--src/WixTestTools/PackageVerifier.cs30
-rw-r--r--src/WixTestTools/WixTestContext.cs10
-rw-r--r--src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs137
-rw-r--r--src/WixToolsetTest.BurnE2E/TestBAController.cs13
21 files changed, 412 insertions, 40 deletions
diff --git a/src/TestBA/TestBA_x64.csproj b/src/TestBA/TestBA_x64.csproj
new file mode 100644
index 00000000..1368e0f0
--- /dev/null
+++ b/src/TestBA/TestBA_x64.csproj
@@ -0,0 +1,24 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- 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. -->
3
4<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <TargetFrameworks>net35;net5.0-windows</TargetFrameworks>
7 <AssemblyName>TestBA</AssemblyName>
8 <RootNamespace>WixToolset.Test.BA</RootNamespace>
9 <DebugType>embedded</DebugType>
10 <RuntimeIdentifier>win-x64</RuntimeIdentifier>
11 <EnableDynamicLoading>true</EnableDynamicLoading>
12 <UseWindowsForms>true</UseWindowsForms>
13 <RollForward>Major</RollForward>
14 </PropertyGroup>
15
16 <ItemGroup Condition=" '$(TargetFramework)'=='net35' ">
17 <Content Include="TestBA.BootstrapperCore.config" CopyToOutputDirectory="PreserveNewest" />
18 <Reference Include="System.Windows.Forms" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.58" />
23 </ItemGroup>
24</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wixproj b/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wixproj
new file mode 100644
index 00000000..f5c53195
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wixproj
@@ -0,0 +1,19 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 <InstallerPlatform>x64</InstallerPlatform>
6 <SuppressSpecificWarnings>1154;$(SuppressSpecificWarnings)</SuppressSpecificWarnings>
7 <BA>hyperlinkLicense</BA>
8 <UpgradeCode>{6E86B95A-24F6-4C89-AF2E-470C0C734FCB}</UpgradeCode>
9 </PropertyGroup>
10 <ItemGroup>
11 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12 </ItemGroup>
13 <ItemGroup>
14 <ProjectReference Include="..\PackageA_x64\PackageA_x64.wixproj" />
15 </ItemGroup>
16 <ItemGroup>
17 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
18 </ItemGroup>
19</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wxs b/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wxs
new file mode 100644
index 00000000..d34e51b6
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wxs
@@ -0,0 +1,10 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <Fragment>
6 <PackageGroup Id="BundlePackages">
7 <MsiPackage Id="PackageA_x64" SourceFile="$(var.PackageA_x64.TargetPath)" />
8 </PackageGroup>
9 </Fragment>
10</Wix>
diff --git a/src/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj b/src/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj
new file mode 100644
index 00000000..8ea9afe0
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj
@@ -0,0 +1,19 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 <UpgradeCode>{02258734-E25E-4A2C-AFC5-55C34F1994CB}</UpgradeCode>
6 </PropertyGroup>
7 <ItemGroup>
8 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
9 <Compile Include="..\BundleA\BundleA.wxs" Link="BundleB.wxs" />
10 </ItemGroup>
11 <ItemGroup>
12 <ProjectReference Include="..\PackageA\PackageA.wixproj" />
13 <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
14 </ItemGroup>
15 <ItemGroup>
16 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
17 <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.73" />
18 </ItemGroup>
19</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/BundleB_x64/BundleB_x64.wixproj b/src/TestData/BasicFunctionalityTests/BundleB_x64/BundleB_x64.wixproj
new file mode 100644
index 00000000..35f78cb8
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleB_x64/BundleB_x64.wixproj
@@ -0,0 +1,22 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 <BA>TestBA_x64</BA>
6 <UpgradeCode>{79F45B7A-D990-46E4-819B-078D87C3321A}</UpgradeCode>
7 <InstallerPlatform>x64</InstallerPlatform>
8 <SuppressSpecificWarnings>1154;$(SuppressSpecificWarnings)</SuppressSpecificWarnings>
9 </PropertyGroup>
10 <ItemGroup>
11 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12 <Compile Include="..\BundleA_x64\BundleA_x64.wxs" Link="BundleB_x64.wxs" />
13 </ItemGroup>
14 <ItemGroup>
15 <ProjectReference Include="..\PackageA_x64\PackageA_x64.wixproj" />
16 <ProjectReference Include="..\..\TestBA\TestBAWixlib_x64\testbawixlib_x64.wixproj" />
17 </ItemGroup>
18 <ItemGroup>
19 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
20 <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.73" />
21 </ItemGroup>
22</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/BundleC/BundleC.wixproj b/src/TestData/BasicFunctionalityTests/BundleC/BundleC.wixproj
new file mode 100644
index 00000000..104a6003
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleC/BundleC.wixproj
@@ -0,0 +1,20 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 <BA>TestBAdnc</BA>
6 <UpgradeCode>{DD790BAA-FE9F-4B0D-8AF4-DE4E1D674637}</UpgradeCode>
7 </PropertyGroup>
8 <ItemGroup>
9 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
10 <Compile Include="..\BundleA\BundleA.wxs" Link="BundleC.wxs" />
11 </ItemGroup>
12 <ItemGroup>
13 <ProjectReference Include="..\PackageA\PackageA.wixproj" />
14 <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
15 </ItemGroup>
16 <ItemGroup>
17 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
18 <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.73" />
19 </ItemGroup>
20</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/BundleC_x64/BundleC_x64.wixproj b/src/TestData/BasicFunctionalityTests/BundleC_x64/BundleC_x64.wixproj
new file mode 100644
index 00000000..aef5e18e
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/BundleC_x64/BundleC_x64.wixproj
@@ -0,0 +1,22 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 <BA>TestBAdnc_x64</BA>
6 <UpgradeCode>{638D31D0-92BA-4BCD-82F0-7F549820D9AB}</UpgradeCode>
7 <InstallerPlatform>x64</InstallerPlatform>
8 <SuppressSpecificWarnings>1154;$(SuppressSpecificWarnings)</SuppressSpecificWarnings>
9 </PropertyGroup>
10 <ItemGroup>
11 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12 <Compile Include="..\BundleA_x64\BundleA_x64.wxs" Link="BundleC_x64.wxs" />
13 </ItemGroup>
14 <ItemGroup>
15 <ProjectReference Include="..\PackageA_x64\PackageA_x64.wixproj" />
16 <ProjectReference Include="..\..\TestBA\TestBAWixlib_x64\testbawixlib_x64.wixproj" />
17 </ItemGroup>
18 <ItemGroup>
19 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
20 <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.73" />
21 </ItemGroup>
22</Project> \ No newline at end of file
diff --git a/src/TestData/BasicFunctionalityTests/PackageA_x64/PackageA_x64.wixproj b/src/TestData/BasicFunctionalityTests/PackageA_x64/PackageA_x64.wixproj
new file mode 100644
index 00000000..8dbab284
--- /dev/null
+++ b/src/TestData/BasicFunctionalityTests/PackageA_x64/PackageA_x64.wixproj
@@ -0,0 +1,10 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <CabPrefix>a_x64</CabPrefix>
5 <UpgradeCode>{BDB9EF6A-B2DE-4929-9BE3-0CD71BDAEF6E}</UpgradeCode>
6 </PropertyGroup>
7 <ItemGroup>
8 <Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
9 </ItemGroup>
10</Project> \ No newline at end of file
diff --git a/src/TestData/Templates/Bundle.wxs b/src/TestData/Templates/Bundle.wxs
index c77bfbd7..06409504 100644
--- a/src/TestData/Templates/Bundle.wxs
+++ b/src/TestData/Templates/Bundle.wxs
@@ -18,6 +18,10 @@
18 <!-- pulled in through the PackageGroupRef below --> 18 <!-- pulled in through the PackageGroupRef below -->
19 <?elseif $(var.BA) = "TestBAdnc"?> 19 <?elseif $(var.BA) = "TestBAdnc"?>
20 <!-- pulled in through the PackageGroupRef below --> 20 <!-- pulled in through the PackageGroupRef below -->
21 <?elseif $(var.BA) = "TestBA_x64"?>
22 <!-- pulled in through the PackageGroupRef below -->
23 <?elseif $(var.BA) = "TestBAdnc_x64"?>
24 <!-- pulled in through the PackageGroupRef below -->
21 <?elseif $(var.BA) = "hyperlinkLicense"?> 25 <?elseif $(var.BA) = "hyperlinkLicense"?>
22 <BootstrapperApplication> 26 <BootstrapperApplication>
23 <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" /> 27 <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" />
@@ -31,6 +35,10 @@
31 <PackageGroupRef Id="TestBA" /> 35 <PackageGroupRef Id="TestBA" />
32 <?elseif $(var.BA) = "TestBAdnc"?> 36 <?elseif $(var.BA) = "TestBAdnc"?>
33 <PackageGroupRef Id="TestBAdnc" /> 37 <PackageGroupRef Id="TestBAdnc" />
38 <?elseif $(var.BA) = "TestBA_x64"?>
39 <PackageGroupRef Id="TestBA_x64" />
40 <?elseif $(var.BA) = "TestBAdnc_x64"?>
41 <PackageGroupRef Id="TestBAdnc_x64" />
34 <?endif?> 42 <?endif?>
35 43
36 <PackageGroupRef Id="BundlePackages" /> 44 <PackageGroupRef Id="BundlePackages" />
diff --git a/src/TestData/Templates/Package.wxs b/src/TestData/Templates/Package.wxs
index e2aaa079..48ed5e02 100644
--- a/src/TestData/Templates/Package.wxs
+++ b/src/TestData/Templates/Package.wxs
@@ -35,7 +35,7 @@
35 </Package> 35 </Package>
36 36
37 <Fragment> 37 <Fragment>
38 <StandardDirectory Id="ProgramFilesFolder"> 38 <StandardDirectory Id="ProgramFiles6432Folder">
39 <Directory Id="WixDir" Name="~Test WiX"> 39 <Directory Id="WixDir" Name="~Test WiX">
40 <Directory Id="TestDir" Name="$(var.TestGroupName)"> 40 <Directory Id="TestDir" Name="$(var.TestGroupName)">
41 <Directory Id="INSTALLFOLDER" Name="$(var.PackageName)" /> 41 <Directory Id="INSTALLFOLDER" Name="$(var.PackageName)" />
diff --git a/src/TestData/TestBA/TestBAWixlib_x64/TestBA_x64.wxs b/src/TestData/TestBA/TestBAWixlib_x64/TestBA_x64.wxs
new file mode 100644
index 00000000..078f4f01
--- /dev/null
+++ b/src/TestData/TestBA/TestBAWixlib_x64/TestBA_x64.wxs
@@ -0,0 +1,30 @@
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<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
3 <Fragment>
4 <BootstrapperApplication>
5 <Payload SourceFile="!(bindpath.dnc5x64)\TestBA.deps.json" />
6 <Payload SourceFile="!(bindpath.dnc5x64)\TestBA.dll" bal:BAFactoryAssembly="yes" />
7 <Payload SourceFile="!(bindpath.dnc5x64)\TestBA.runtimeconfig.json" />
8 <Payload SourceFile="!(bindpath.dnc5x64)\mbanative.dll" />
9 <Payload SourceFile="!(bindpath.dnc5x64)\WixToolset.Mba.Core.dll" />
10 <bal:WixDotNetCoreBootstrapperApplicationHost />
11 </BootstrapperApplication>
12
13 <PackageGroup Id="TestBAdnc_x64">
14 <PackageGroupRef Id="NetFx48WebAsPrereq" /> <!-- Yes, this is wrong but we don't have .NET 5 packages yet -->
15 </PackageGroup>
16 </Fragment>
17 <Fragment>
18 <BootstrapperApplication>
19 <Payload Name="WixToolset.Mba.Host.config" SourceFile="!(bindpath.net2x64)\TestBA.BootstrapperCore.config" />
20 <Payload SourceFile="!(bindpath.net2x64)\TestBA.dll" />
21 <Payload SourceFile="!(bindpath.net2x64)\mbanative.dll" />
22 <Payload SourceFile="!(bindpath.net2x64)\WixToolset.Mba.Core.dll" />
23 <bal:WixManagedBootstrapperApplicationHost />
24 </BootstrapperApplication>
25
26 <PackageGroup Id="TestBA_x64">
27 <PackageGroupRef Id="NetFx48WebAsPrereq" />
28 </PackageGroup>
29 </Fragment>
30</Wix>
diff --git a/src/TestData/TestBA/TestBAWixlib_x64/TestExe_x64.wxs b/src/TestData/TestBA/TestBAWixlib_x64/TestExe_x64.wxs
new file mode 100644
index 00000000..02bed038
--- /dev/null
+++ b/src/TestData/TestBA/TestBAWixlib_x64/TestExe_x64.wxs
@@ -0,0 +1,9 @@
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<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <PayloadGroup Id="TestExePayloads_x64">
5 <ExePackagePayload SourceFile="!(bindpath.net2x64)\TestExe.exe" />
6 <Payload SourceFile="!(bindpath.net2x64)\TestExe.exe.config" />
7 </PayloadGroup>
8 </Fragment>
9</Wix>
diff --git a/src/TestData/TestBA/TestBAWixlib_x64/testbawixlib_x64.wixproj b/src/TestData/TestBA/TestBAWixlib_x64/testbawixlib_x64.wixproj
new file mode 100644
index 00000000..9b7d3c17
--- /dev/null
+++ b/src/TestData/TestBA/TestBAWixlib_x64/testbawixlib_x64.wixproj
@@ -0,0 +1,20 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Library</OutputType>
5 <BindFiles>true</BindFiles>
6 <Cultures>en-us</Cultures>
7 <InstallerPlatform>x64</InstallerPlatform>
8 </PropertyGroup>
9 <ItemGroup>
10 <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net35\win-x64" BindName="net2x64" />
11 <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net5.0-windows\win-x64" BindName="dnc5x64" />
12 </ItemGroup>
13 <ItemGroup>
14 <ProjectReference Include="..\..\..\TestBA\TestBA_x64.csproj" />
15 <ProjectReference Include="..\..\..\TestExe\TestExe_x64.csproj" />
16 </ItemGroup>
17 <ItemGroup>
18 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.101" />
19 </ItemGroup>
20</Project> \ No newline at end of file
diff --git a/src/TestExe/TestExe_x64.csproj b/src/TestExe/TestExe_x64.csproj
new file mode 100644
index 00000000..1dd2d8e6
--- /dev/null
+++ b/src/TestExe/TestExe_x64.csproj
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- 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. -->
3
4<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <TargetFrameworks>net35</TargetFrameworks>
7 <AssemblyName>TestExe</AssemblyName>
8 <RootNamespace>TestExe</RootNamespace>
9 <OutputType>Exe</OutputType>
10 <DebugType>embedded</DebugType>
11 <RuntimeIdentifier>win-x64</RuntimeIdentifier>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Reference Include="System.Management" />
16 </ItemGroup>
17</Project> \ No newline at end of file
diff --git a/src/WixTestTools/BundleRegistration.cs b/src/WixTestTools/BundleRegistration.cs
index bf9e2903..75660838 100644
--- a/src/WixTestTools/BundleRegistration.cs
+++ b/src/WixTestTools/BundleRegistration.cs
@@ -88,9 +88,10 @@ namespace WixTestTools
88 88
89 public string Version { get; set; } 89 public string Version { get; set; }
90 90
91 public static bool TryGetPerMachineBundleRegistrationById(string bundleId, out BundleRegistration registration) 91 public static bool TryGetPerMachineBundleRegistrationById(string bundleId, bool x64, out BundleRegistration registration)
92 { 92 {
93 var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE}\\{bundleId}"; 93 var baseKeyPath = x64 ? BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY : BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE;
94 var registrationKeyPath = $"{baseKeyPath}\\{bundleId}";
94 using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath); 95 using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath);
95 var success = registrationKey != null; 96 var success = registrationKey != null;
96 registration = success ? GetBundleRegistration(registrationKey) : null; 97 registration = success ? GetBundleRegistration(registrationKey) : null;
diff --git a/src/WixTestTools/BundleVerifier.cs b/src/WixTestTools/BundleVerifier.cs
index 293da560..984df169 100644
--- a/src/WixTestTools/BundleVerifier.cs
+++ b/src/WixTestTools/BundleVerifier.cs
@@ -73,10 +73,11 @@ namespace WixTestTools
73 public bool TryGetRegistration(out BundleRegistration registration) 73 public bool TryGetRegistration(out BundleRegistration registration)
74 { 74 {
75 var bundleSymbol = this.GetBundleSymbol(); 75 var bundleSymbol = this.GetBundleSymbol();
76 var x64 = bundleSymbol.Platform != Platform.X86;
76 var bundleId = bundleSymbol.BundleId; 77 var bundleId = bundleSymbol.BundleId;
77 if (bundleSymbol.PerMachine) 78 if (bundleSymbol.PerMachine)
78 { 79 {
79 return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, out registration); 80 return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, x64, out registration);
80 } 81 }
81 else 82 else
82 { 83 {
@@ -132,9 +133,9 @@ namespace WixTestTools
132 Assert.True(Directory.Exists(cachePath)); 133 Assert.True(Directory.Exists(cachePath));
133 } 134 }
134 135
135 public void VerifyExeTestRegistryRootDeleted(string name) 136 public void VerifyExeTestRegistryRootDeleted(string name, bool x64 = false)
136 { 137 {
137 using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(name); 138 using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(x64, name);
138 if (testRegistryRoot != null) 139 if (testRegistryRoot != null)
139 { 140 {
140 var actualValue = testRegistryRoot.GetValue("Version") as string; 141 var actualValue = testRegistryRoot.GetValue("Version") as string;
@@ -142,9 +143,9 @@ namespace WixTestTools
142 } 143 }
143 } 144 }
144 145
145 public void VerifyExeTestRegistryValue(string name, string expectedValue) 146 public void VerifyExeTestRegistryValue(string name, string expectedValue, bool x64 = false)
146 { 147 {
147 using (var root = this.TestContext.GetTestRegistryRoot(name)) 148 using (var root = this.TestContext.GetTestRegistryRoot(x64, name))
148 { 149 {
149 Assert.NotNull(root); 150 Assert.NotNull(root);
150 var actualValue = root.GetValue("Version") as string; 151 var actualValue = root.GetValue("Version") as string;
diff --git a/src/WixTestTools/PackageInstaller.cs b/src/WixTestTools/PackageInstaller.cs
index 86376b9f..d32f499b 100644
--- a/src/WixTestTools/PackageInstaller.cs
+++ b/src/WixTestTools/PackageInstaller.cs
@@ -4,6 +4,10 @@ namespace WixTestTools
4{ 4{
5 using System; 5 using System;
6 using System.IO; 6 using System.IO;
7 using System.Linq;
8 using WixToolset.Data;
9 using WixToolset.Data.Symbols;
10 using WixToolset.Data.WindowsInstaller;
7 using static WixTestTools.MSIExec; 11 using static WixTestTools.MSIExec;
8 12
9 public partial class PackageInstaller : IDisposable 13 public partial class PackageInstaller : IDisposable
@@ -13,6 +17,16 @@ namespace WixTestTools
13 this.Package = Path.Combine(testContext.TestDataFolder, $"{filename}.msi"); 17 this.Package = Path.Combine(testContext.TestDataFolder, $"{filename}.msi");
14 this.PackagePdb = Path.Combine(testContext.TestDataFolder, $"{filename}.wixpdb"); 18 this.PackagePdb = Path.Combine(testContext.TestDataFolder, $"{filename}.wixpdb");
15 this.TestContext = testContext; 19 this.TestContext = testContext;
20
21 using var wixOutput = WixOutput.Read(this.PackagePdb);
22
23 var intermediate = Intermediate.Load(wixOutput);
24 var section = intermediate.Sections.Single();
25 var platformSummary = section.Symbols.OfType<SummaryInformationSymbol>().Single(s => s.PropertyId == SummaryInformationType.PlatformAndLanguage);
26 var platformString = platformSummary.Value.Split(new char[] { ';' }, 2)[0];
27 this.IsX64 = platformString != "Intel";
28
29 this.WiData = WindowsInstallerData.Load(wixOutput);
16 } 30 }
17 31
18 public string Package { get; } 32 public string Package { get; }
diff --git a/src/WixTestTools/PackageVerifier.cs b/src/WixTestTools/PackageVerifier.cs
index 073e83b0..2f42dd21 100644
--- a/src/WixTestTools/PackageVerifier.cs
+++ b/src/WixTestTools/PackageVerifier.cs
@@ -5,7 +5,6 @@ namespace WixTestTools
5 using System; 5 using System;
6 using System.IO; 6 using System.IO;
7 using System.Linq; 7 using System.Linq;
8 using WixToolset.Data;
9 using WixToolset.Data.WindowsInstaller; 8 using WixToolset.Data.WindowsInstaller;
10 using WixToolset.Data.WindowsInstaller.Rows; 9 using WixToolset.Data.WindowsInstaller.Rows;
11 using Xunit; 10 using Xunit;
@@ -14,28 +13,18 @@ namespace WixTestTools
14 { 13 {
15 public string PackagePdb { get; } 14 public string PackagePdb { get; }
16 15
17 private WindowsInstallerData WiData { get; set; } 16 private bool IsX64 { get; }
18 17
19 public string GetInstalledFilePath(string filename) 18 private WindowsInstallerData WiData { get; }
20 {
21 return this.TestContext.GetTestInstallFolder(Path.Combine(this.GetInstallFolderName(), filename));
22 }
23 19
24 private WindowsInstallerData GetWindowsInstallerData() 20 public string GetInstalledFilePath(string filename)
25 { 21 {
26 if (this.WiData == null) 22 return this.TestContext.GetTestInstallFolder(this.IsX64, Path.Combine(this.GetInstallFolderName(), filename));
27 {
28 using var wixOutput = WixOutput.Read(this.PackagePdb);
29 this.WiData = WindowsInstallerData.Load(wixOutput);
30 }
31
32 return this.WiData;
33 } 23 }
34 24
35 public string GetInstallFolderName() 25 public string GetInstallFolderName()
36 { 26 {
37 var wiData = this.GetWindowsInstallerData(); 27 var row = this.WiData.Tables["Directory"].Rows.Single(r => r.FieldAsString(0) == "INSTALLFOLDER");
38 var row = wiData.Tables["Directory"].Rows.Single(r => r.FieldAsString(0) == "INSTALLFOLDER");
39 var value = row.FieldAsString(2); 28 var value = row.FieldAsString(2);
40 var longNameIndex = value.IndexOf('|') + 1; 29 var longNameIndex = value.IndexOf('|') + 1;
41 if (longNameIndex > 0) 30 if (longNameIndex > 0)
@@ -47,8 +36,7 @@ namespace WixTestTools
47 36
48 public string GetProperty(string name) 37 public string GetProperty(string name)
49 { 38 {
50 var wiData = this.GetWindowsInstallerData(); 39 var row = this.WiData.Tables["Property"].Rows.Cast<PropertyRow>().Single(r => r.Property == name);
51 var row = wiData.Tables["Property"].Rows.Cast<PropertyRow>().Single(r => r.Property == name);
52 return row.Value; 40 return row.Value;
53 } 41 }
54 42
@@ -67,7 +55,7 @@ namespace WixTestTools
67 55
68 public void DeleteTestRegistryValue(string name) 56 public void DeleteTestRegistryValue(string name)
69 { 57 {
70 using (var root = this.TestContext.GetTestRegistryRoot()) 58 using (var root = this.TestContext.GetTestRegistryRoot(this.IsX64))
71 { 59 {
72 Assert.NotNull(root); 60 Assert.NotNull(root);
73 root.DeleteValue(name); 61 root.DeleteValue(name);
@@ -76,13 +64,13 @@ namespace WixTestTools
76 64
77 public void VerifyTestRegistryRootDeleted() 65 public void VerifyTestRegistryRootDeleted()
78 { 66 {
79 using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(); 67 using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(this.IsX64);
80 Assert.Null(testRegistryRoot); 68 Assert.Null(testRegistryRoot);
81 } 69 }
82 70
83 public void VerifyTestRegistryValue(string name, string expectedValue) 71 public void VerifyTestRegistryValue(string name, string expectedValue)
84 { 72 {
85 using (var root = this.TestContext.GetTestRegistryRoot()) 73 using (var root = this.TestContext.GetTestRegistryRoot(this.IsX64))
86 { 74 {
87 Assert.NotNull(root); 75 Assert.NotNull(root);
88 var actualValue = root.GetValue(name) as string; 76 var actualValue = root.GetValue(name) as string;
diff --git a/src/WixTestTools/WixTestContext.cs b/src/WixTestTools/WixTestContext.cs
index c00f5723..a4e666f1 100644
--- a/src/WixTestTools/WixTestContext.cs
+++ b/src/WixTestTools/WixTestContext.cs
@@ -42,9 +42,10 @@ namespace WixTestTools
42 /// <remarks> 42 /// <remarks>
43 /// The package or bundle must install into [ProgramFilesFolder]\~Test WiX\[TestGroupName]\([Additional]). 43 /// The package or bundle must install into [ProgramFilesFolder]\~Test WiX\[TestGroupName]\([Additional]).
44 /// </remarks> 44 /// </remarks>
45 public string GetTestInstallFolder(string additionalPath = null) 45 public string GetTestInstallFolder(bool x64, string additionalPath = null)
46 { 46 {
47 return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "~Test WiX", this.TestGroupName, additionalPath ?? String.Empty); 47 var baseDirectory = x64 ? Environment.SpecialFolder.ProgramFiles : Environment.SpecialFolder.ProgramFilesX86;
48 return Path.Combine(Environment.GetFolderPath(baseDirectory), "~Test WiX", this.TestGroupName, additionalPath ?? String.Empty);
48 } 49 }
49 50
50 /// <summary> 51 /// <summary>
@@ -55,9 +56,10 @@ namespace WixTestTools
55 /// <remarks> 56 /// <remarks>
56 /// The package must write into HKLM\Software\WiX\Tests\[TestGroupName]\([Additional]). 57 /// The package must write into HKLM\Software\WiX\Tests\[TestGroupName]\([Additional]).
57 /// </remarks> 58 /// </remarks>
58 public RegistryKey GetTestRegistryRoot(string additionalPath = null) 59 public RegistryKey GetTestRegistryRoot(bool x64, string additionalPath = null)
59 { 60 {
60 var key = String.Format(@"Software\WOW6432Node\WiX\Tests\{0}\{1}", this.TestGroupName, additionalPath ?? String.Empty); 61 var baseKey = x64 ? "Software" : @"Software\WOW6432Node";
62 var key = String.Format(@"{0}\WiX\Tests\{1}\{2}", baseKey, this.TestGroupName, additionalPath ?? String.Empty);
61 return Registry.LocalMachine.OpenSubKey(key, true); 63 return Registry.LocalMachine.OpenSubKey(key, true);
62 } 64 }
63 65
diff --git a/src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs b/src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
index edd8536b..5df86fff 100644
--- a/src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
+++ b/src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12 public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } 12 public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13 13
14 [Fact] 14 [Fact]
15 public void CanInstallAndUninstallSimpleBundle() 15 public void CanInstallAndUninstallSimpleBundle_x86_wixstdba()
16 { 16 {
17 var packageA = this.CreatePackageInstaller("PackageA"); 17 var packageA = this.CreatePackageInstaller("PackageA");
18 18
@@ -37,5 +37,140 @@ namespace WixToolsetTest.BurnE2E
37 37
38 bundleA.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath); 38 bundleA.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
39 } 39 }
40
41 [Fact]
42 public void CanInstallAndUninstallSimpleBundle_x86_testba()
43 {
44 var packageA = this.CreatePackageInstaller("PackageA");
45
46 var bundleB = this.CreateBundleInstaller("BundleB");
47
48 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
49
50 // Source file should *not* be installed
51 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
52
53 bundleB.Install();
54
55 var cachedBundlePath = bundleB.VerifyRegisteredAndInPackageCache();
56
57 // Source file should be installed
58 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
59
60 bundleB.Uninstall(cachedBundlePath);
61
62 // Source file should *not* be installed
63 Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A payload should have been removed by uninstall from: ", packageASourceCodeInstalled));
64
65 bundleB.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
66 }
67
68 [Fact]
69 public void CanInstallAndUninstallSimpleBundle_x86_dnctestba()
70 {
71 var packageA = this.CreatePackageInstaller("PackageA");
72
73 var bundleC = this.CreateBundleInstaller("BundleC");
74
75 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
76
77 // Source file should *not* be installed
78 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
79
80 bundleC.Install();
81
82 var cachedBundlePath = bundleC.VerifyRegisteredAndInPackageCache();
83
84 // Source file should be installed
85 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
86
87 bundleC.Uninstall(cachedBundlePath);
88
89 // Source file should *not* be installed
90 Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A payload should have been removed by uninstall from: ", packageASourceCodeInstalled));
91
92 bundleC.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
93 }
94
95 [Fact]
96 public void CanInstallAndUninstallSimpleBundle_x64_wixstdba()
97 {
98 var packageA_x64 = this.CreatePackageInstaller("PackageA_x64");
99
100 var bundleA_x64 = this.CreateBundleInstaller("BundleA_x64");
101
102 var packageASourceCodeInstalled = packageA_x64.GetInstalledFilePath("Package.wxs");
103
104 // Source file should *not* be installed
105 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A x64 payload should not be there on test start: {packageASourceCodeInstalled}");
106
107 bundleA_x64.Install();
108
109 var cachedBundlePath = bundleA_x64.VerifyRegisteredAndInPackageCache();
110
111 // Source file should be installed
112 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A x64 payload installed at: ", packageASourceCodeInstalled));
113
114 bundleA_x64.Uninstall(cachedBundlePath);
115
116 // Source file should *not* be installed
117 Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A x64 payload should have been removed by uninstall from: ", packageASourceCodeInstalled));
118
119 bundleA_x64.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
120 }
121
122 [Fact]
123 public void CanInstallAndUninstallSimpleBundle_x64_testba()
124 {
125 var packageA_x64 = this.CreatePackageInstaller("PackageA_x64");
126
127 var bundleB_x64 = this.CreateBundleInstaller("BundleB_x64");
128
129 var packageASourceCodeInstalled = packageA_x64.GetInstalledFilePath("Package.wxs");
130
131 // Source file should *not* be installed
132 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A x64 payload should not be there on test start: {packageASourceCodeInstalled}");
133
134 bundleB_x64.Install();
135
136 var cachedBundlePath = bundleB_x64.VerifyRegisteredAndInPackageCache();
137
138 // Source file should be installed
139 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A x64 payload installed at: ", packageASourceCodeInstalled));
140
141 bundleB_x64.Uninstall(cachedBundlePath);
142
143 // Source file should *not* be installed
144 Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A x64 payload should have been removed by uninstall from: ", packageASourceCodeInstalled));
145
146 bundleB_x64.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
147 }
148
149 [Fact]
150 public void CanInstallAndUninstallSimpleBundle_x64_dnctestba()
151 {
152 var packageA_x64 = this.CreatePackageInstaller("PackageA_x64");
153
154 var bundleC_x64 = this.CreateBundleInstaller("BundleC_x64");
155
156 var packageASourceCodeInstalled = packageA_x64.GetInstalledFilePath("Package.wxs");
157
158 // Source file should *not* be installed
159 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A x64 payload should not be there on test start: {packageASourceCodeInstalled}");
160
161 bundleC_x64.Install();
162
163 var cachedBundlePath = bundleC_x64.VerifyRegisteredAndInPackageCache();
164
165 // Source file should be installed
166 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A x64 payload installed at: ", packageASourceCodeInstalled));
167
168 bundleC_x64.Uninstall(cachedBundlePath);
169
170 // Source file should *not* be installed
171 Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A x64 payload should have been removed by uninstall from: ", packageASourceCodeInstalled));
172
173 bundleC_x64.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
174 }
40 } 175 }
41} 176}
diff --git a/src/WixToolsetTest.BurnE2E/TestBAController.cs b/src/WixToolsetTest.BurnE2E/TestBAController.cs
index 103b603b..6e4fe6c6 100644
--- a/src/WixToolsetTest.BurnE2E/TestBAController.cs
+++ b/src/WixToolsetTest.BurnE2E/TestBAController.cs
@@ -9,14 +9,15 @@ namespace WixToolsetTest.BurnE2E
9 9
10 public class TestBAController : IDisposable 10 public class TestBAController : IDisposable
11 { 11 {
12 private const string BaseRegKeyPath = @"Software\WOW6432Node\WiX\Tests"; 12 public TestBAController(WixTestContext testContext, bool x64 = false)
13
14 public TestBAController(WixTestContext testContext)
15 { 13 {
16 this.TestGroupName = testContext.TestGroupName; 14 this.TestGroupName = testContext.TestGroupName;
17 this.TestBaseRegKeyPath = String.Format(@"{0}\TestBAControl\{1}", BaseRegKeyPath, this.TestGroupName); 15 this.BaseRegKeyPath = x64 ? @"Software\WiX\Tests" : @"Software\WOW6432Node\WiX\Tests";
16 this.TestBaseRegKeyPath = String.Format(@"{0}\TestBAControl\{1}", this.BaseRegKeyPath, this.TestGroupName);
18 } 17 }
19 18
19 private string BaseRegKeyPath { get; }
20
20 private string TestBaseRegKeyPath { get; } 21 private string TestBaseRegKeyPath { get; }
21 22
22 public string TestGroupName { get; } 23 public string TestGroupName { get; }
@@ -179,8 +180,8 @@ namespace WixToolsetTest.BurnE2E
179 180
180 public void Dispose() 181 public void Dispose()
181 { 182 {
182 Registry.LocalMachine.DeleteSubKeyTree($@"{BaseRegKeyPath}\{this.TestGroupName}", false); 183 Registry.LocalMachine.DeleteSubKeyTree($@"{this.BaseRegKeyPath}\{this.TestGroupName}", false);
183 Registry.LocalMachine.DeleteSubKeyTree($@"{BaseRegKeyPath}\TestBAControl", false); 184 Registry.LocalMachine.DeleteSubKeyTree($@"{this.BaseRegKeyPath}\TestBAControl", false);
184 } 185 }
185 } 186 }
186} 187}