@joebigelow / wix / commits / 70f6c041

Add x64 Bundle tests.

Sean Hall committed May 1, 2021 at 20:44 UTC 70f6c04122db39b5d234715c373d690f97892f8b
22 files changed +412 -42
BurnE2ETests.sln
-2
@@ -73,8 +73,6 @@ Global
73 GlobalSection(SolutionProperties) = preSolution
74 HideSolutionNode = FALSE
75 EndGlobalSection
76 - GlobalSection(NestedProjects) = preSolution
77 - EndGlobalSection
76 GlobalSection(ExtensibilityGlobals) = postSolution
77 SolutionGuid = {74DE2EED-ECAA-4FDD-9792-9D3B0C0C1321}
78 EndGlobalSection
src/TestBA/TestBA_x64.csproj new
+24
@@ -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
src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wixproj new
+19
@@ -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
src/TestData/BasicFunctionalityTests/BundleA_x64/BundleA_x64.wxs new
+10
@@ -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>
src/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj new
+19
@@ -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
src/TestData/BasicFunctionalityTests/BundleB_x64/BundleB_x64.wixproj new
+22
@@ -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
src/TestData/BasicFunctionalityTests/BundleC/BundleC.wixproj new
+20
@@ -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
src/TestData/BasicFunctionalityTests/BundleC_x64/BundleC_x64.wixproj new
+22
@@ -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
src/TestData/BasicFunctionalityTests/PackageA_x64/PackageA_x64.wixproj new
+10
@@ -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
src/TestData/Templates/Bundle.wxs
+8
@@ -18,6 +18,10 @@
18 <!-- pulled in through the PackageGroupRef below -->
19 <?elseif $(var.BA) = "TestBAdnc"?>
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 -->
25 <?elseif $(var.BA) = "hyperlinkLicense"?>
26 <BootstrapperApplication>
27 <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" />
@@ -31,6 +35,10 @@
35 <PackageGroupRef Id="TestBA" />
36 <?elseif $(var.BA) = "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" />
42 <?endif?>
43
44 <PackageGroupRef Id="BundlePackages" />
src/TestData/Templates/Package.wxs
+1 -1
@@ -35,7 +35,7 @@
35 </Package>
36
37 <Fragment>
38 - <StandardDirectory Id="ProgramFilesFolder">
38 + <StandardDirectory Id="ProgramFiles6432Folder">
39 <Directory Id="WixDir" Name="~Test WiX">
40 <Directory Id="TestDir" Name="$(var.TestGroupName)">
41 <Directory Id="INSTALLFOLDER" Name="$(var.PackageName)" />
src/TestData/TestBA/TestBAWixlib_x64/TestBA_x64.wxs new
+30
@@ -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>
src/TestData/TestBA/TestBAWixlib_x64/TestExe_x64.wxs new
+9
@@ -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>
src/TestData/TestBA/TestBAWixlib_x64/testbawixlib_x64.wixproj new
+20
@@ -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
src/TestExe/TestExe_x64.csproj new
+17
@@ -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
src/WixTestTools/BundleRegistration.cs
+3 -2
@@ -88,9 +88,10 @@ namespace WixTestTools
88
89 public string Version { get; set; }
90
91 - public static bool TryGetPerMachineBundleRegistrationById(string bundleId, out BundleRegistration registration)
91 + public static bool TryGetPerMachineBundleRegistrationById(string bundleId, bool x64, out BundleRegistration registration)
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}";
95 using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath);
96 var success = registrationKey != null;
97 registration = success ? GetBundleRegistration(registrationKey) : null;
src/WixTestTools/BundleVerifier.cs
+6 -5
@@ -73,10 +73,11 @@ namespace WixTestTools
73 public bool TryGetRegistration(out BundleRegistration registration)
74 {
75 var bundleSymbol = this.GetBundleSymbol();
76 + var x64 = bundleSymbol.Platform != Platform.X86;
77 var bundleId = bundleSymbol.BundleId;
78 if (bundleSymbol.PerMachine)
79 {
79 - return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, out registration);
80 + return BundleRegistration.TryGetPerMachineBundleRegistrationById(bundleId, x64, out registration);
81 }
82 else
83 {
@@ -132,9 +133,9 @@ namespace WixTestTools
133 Assert.True(Directory.Exists(cachePath));
134 }
135
135 - public void VerifyExeTestRegistryRootDeleted(string name)
136 + public void VerifyExeTestRegistryRootDeleted(string name, bool x64 = false)
137 {
137 - using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(name);
138 + using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(x64, name);
139 if (testRegistryRoot != null)
140 {
141 var actualValue = testRegistryRoot.GetValue("Version") as string;
@@ -142,9 +143,9 @@ namespace WixTestTools
143 }
144 }
145
145 - public void VerifyExeTestRegistryValue(string name, string expectedValue)
146 + public void VerifyExeTestRegistryValue(string name, string expectedValue, bool x64 = false)
147 {
147 - using (var root = this.TestContext.GetTestRegistryRoot(name))
148 + using (var root = this.TestContext.GetTestRegistryRoot(x64, name))
149 {
150 Assert.NotNull(root);
151 var actualValue = root.GetValue("Version") as string;
src/WixTestTools/PackageInstaller.cs
+14
@@ -4,6 +4,10 @@ namespace WixTestTools
4 {
5 using System;
6 using System.IO;
7 + using System.Linq;
8 + using WixToolset.Data;
9 + using WixToolset.Data.Symbols;
10 + using WixToolset.Data.WindowsInstaller;
11 using static WixTestTools.MSIExec;
12
13 public partial class PackageInstaller : IDisposable
@@ -13,6 +17,16 @@ namespace WixTestTools
17 this.Package = Path.Combine(testContext.TestDataFolder, $"{filename}.msi");
18 this.PackagePdb = Path.Combine(testContext.TestDataFolder, $"{filename}.wixpdb");
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);
30 }
31
32 public string Package { get; }
src/WixTestTools/PackageVerifier.cs
+9 -21
@@ -5,7 +5,6 @@ namespace WixTestTools
5 using System;
6 using System.IO;
7 using System.Linq;
8 - using WixToolset.Data;
8 using WixToolset.Data.WindowsInstaller;
9 using WixToolset.Data.WindowsInstaller.Rows;
10 using Xunit;
@@ -14,28 +13,18 @@ namespace WixTestTools
13 {
14 public string PackagePdb { get; }
15
17 - private WindowsInstallerData WiData { get; set; }
16 + private bool IsX64 { get; }
17
19 - public string GetInstalledFilePath(string filename)
20 - {
21 - return this.TestContext.GetTestInstallFolder(Path.Combine(this.GetInstallFolderName(), filename));
22 - }
18 + private WindowsInstallerData WiData { get; }
19
24 - private WindowsInstallerData GetWindowsInstallerData()
20 + public string GetInstalledFilePath(string filename)
21 {
26 - if (this.WiData == null)
27 - {
28 - using var wixOutput = WixOutput.Read(this.PackagePdb);
29 - this.WiData = WindowsInstallerData.Load(wixOutput);
30 - }
31 -
32 - return this.WiData;
22 + return this.TestContext.GetTestInstallFolder(this.IsX64, Path.Combine(this.GetInstallFolderName(), filename));
23 }
24
25 public string GetInstallFolderName()
26 {
37 - var wiData = this.GetWindowsInstallerData();
38 - var row = wiData.Tables["Directory"].Rows.Single(r => r.FieldAsString(0) == "INSTALLFOLDER");
27 + var row = this.WiData.Tables["Directory"].Rows.Single(r => r.FieldAsString(0) == "INSTALLFOLDER");
28 var value = row.FieldAsString(2);
29 var longNameIndex = value.IndexOf('|') + 1;
30 if (longNameIndex > 0)
@@ -47,8 +36,7 @@ namespace WixTestTools
36
37 public string GetProperty(string name)
38 {
50 - var wiData = this.GetWindowsInstallerData();
51 - var row = wiData.Tables["Property"].Rows.Cast<PropertyRow>().Single(r => r.Property == name);
39 + var row = this.WiData.Tables["Property"].Rows.Cast<PropertyRow>().Single(r => r.Property == name);
40 return row.Value;
41 }
42
@@ -67,7 +55,7 @@ namespace WixTestTools
55
56 public void DeleteTestRegistryValue(string name)
57 {
70 - using (var root = this.TestContext.GetTestRegistryRoot())
58 + using (var root = this.TestContext.GetTestRegistryRoot(this.IsX64))
59 {
60 Assert.NotNull(root);
61 root.DeleteValue(name);
@@ -76,13 +64,13 @@ namespace WixTestTools
64
65 public void VerifyTestRegistryRootDeleted()
66 {
79 - using var testRegistryRoot = this.TestContext.GetTestRegistryRoot();
67 + using var testRegistryRoot = this.TestContext.GetTestRegistryRoot(this.IsX64);
68 Assert.Null(testRegistryRoot);
69 }
70
71 public void VerifyTestRegistryValue(string name, string expectedValue)
72 {
85 - using (var root = this.TestContext.GetTestRegistryRoot())
73 + using (var root = this.TestContext.GetTestRegistryRoot(this.IsX64))
74 {
75 Assert.NotNull(root);
76 var actualValue = root.GetValue(name) as string;
src/WixTestTools/WixTestContext.cs
+6 -4
@@ -42,9 +42,10 @@ namespace WixTestTools
42 /// <remarks>
43 /// The package or bundle must install into [ProgramFilesFolder]\~Test WiX\[TestGroupName]\([Additional]).
44 /// </remarks>
45 - public string GetTestInstallFolder(string additionalPath = null)
45 + public string GetTestInstallFolder(bool x64, string additionalPath = null)
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);
49 }
50
51 /// <summary>
@@ -55,9 +56,10 @@ namespace WixTestTools
56 /// <remarks>
57 /// The package must write into HKLM\Software\WiX\Tests\[TestGroupName]\([Additional]).
58 /// </remarks>
58 - public RegistryKey GetTestRegistryRoot(string additionalPath = null)
59 + public RegistryKey GetTestRegistryRoot(bool x64, string additionalPath = null)
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);
63 return Registry.LocalMachine.OpenSubKey(key, true);
64 }
65
src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
+136 -1
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12 public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13
14 [Fact]
15 - public void CanInstallAndUninstallSimpleBundle()
15 + public void CanInstallAndUninstallSimpleBundle_x86_wixstdba()
16 {
17 var packageA = this.CreatePackageInstaller("PackageA");
18
@@ -37,5 +37,140 @@ namespace WixToolsetTest.BurnE2E
37
38 bundleA.VerifyUnregisteredAndRemovedFromPackageCache(cachedBundlePath);
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 + }
175 }
176 }
src/WixToolsetTest.BurnE2E/TestBAController.cs
+7 -6
@@ -9,14 +9,15 @@ namespace WixToolsetTest.BurnE2E
9
10 public class TestBAController : IDisposable
11 {
12 - private const string BaseRegKeyPath = @"Software\WOW6432Node\WiX\Tests";
13 -
14 - public TestBAController(WixTestContext testContext)
12 + public TestBAController(WixTestContext testContext, bool x64 = false)
13 {
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);
17 }
18
19 + private string BaseRegKeyPath { get; }
20 +
21 private string TestBaseRegKeyPath { get; }
22
23 public string TestGroupName { get; }
@@ -179,8 +180,8 @@ namespace WixToolsetTest.BurnE2E
180
181 public void Dispose()
182 {
182 - Registry.LocalMachine.DeleteSubKeyTree($@"{BaseRegKeyPath}\{this.TestGroupName}", false);
183 - Registry.LocalMachine.DeleteSubKeyTree($@"{BaseRegKeyPath}\TestBAControl", false);
183 + Registry.LocalMachine.DeleteSubKeyTree($@"{this.BaseRegKeyPath}\{this.TestGroupName}", false);
184 + Registry.LocalMachine.DeleteSubKeyTree($@"{this.BaseRegKeyPath}\TestBAControl", false);
185 }
186 }
187 }