From c6e2213e818b869c44c1af7355fc06f45ebf1a1f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Feb 2021 13:46:45 -0800 Subject: Replace Win64 attribute with Bitness attribute Closes wixtoolset/#4707 --- .../ApprovedExeFixture.cs | 64 ++++++++++++++++++++++ .../MsiQueryFixture.cs | 34 ++++++++++++ .../DecompiledNestedDirSearchUnderRegSearch.wxs | 12 ++-- .../TestData/AppSearch/RegistrySearch64.wxs | 12 ++++ .../TestData/BundleWithApprovedExe/Bundle.wxs | 5 ++ .../TestData/BundleWithApprovedExe/Bundle64.wxs | 5 ++ .../TestData/Class/DecompiledOldClassTableDef.wxs | 4 +- .../TestData/CustomTable/CustomTable-Expected.wxs | 4 +- .../TestData/DecompileNullComponent/Expected.wxs | 4 +- .../DecompileSingleFileCompressed/Expected.wxs | 4 +- .../DecompileSingleFileCompressed64/Expected.wxs | 4 +- .../SequenceTables/DecompiledSequenceTables.wxs | 4 +- .../TestData/Shortcut/DecompiledShortcuts.wxs | 4 +- 13 files changed, 140 insertions(+), 20 deletions(-) create mode 100644 src/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch64.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle64.wxs (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs new file mode 100644 index 00000000..47b47ef5 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs @@ -0,0 +1,64 @@ +// 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. + +namespace WixToolsetTest.CoreIntegration +{ + using System.IO; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using Xunit; + + public class ApprovedExeFixture + { + [Fact] + public void CanBuildWithApprovedExe() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var exePath = Path.Combine(baseFolder, @"bin\test.exe"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BundleWithApprovedExe", "Bundle.wxs"), + "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), + "-bindpath", Path.Combine(folder, ".Data"), + "-intermediateFolder", intermediateFolder, + "-o", exePath, + }); + + Assert.NotEqual(0, result.ExitCode); + Assert.False(File.Exists(exePath)); + } + } + + [Fact] + public void CanBuildWithApprovedExe64() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var exePath = Path.Combine(baseFolder, @"bin\test.exe"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BundleWithApprovedExe", "Bundle64.wxs"), + "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), + "-bindpath", Path.Combine(folder, ".Data"), + "-intermediateFolder", intermediateFolder, + "-o", exePath, + }); + + Assert.NotEqual(0, result.ExitCode); + Assert.False(File.Exists(exePath)); + } + } + } +} diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 00738965..8c3487f0 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -185,6 +185,40 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void PopulatesAppSearchTablesFromRegistrySearch64() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "AppSearch", "RegistrySearch64.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), + "-bindpath", Path.Combine(folder, "SingleFile", "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(msiPath)); + var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "RegLocator" }); + WixAssert.CompareLineByLine(new[] + { + "AppSearch:SAMPLEREGFOUND\tSampleRegSearch", + "RegLocator:SampleRegSearch\t2\tSampleReg\t\t18", + }, results); + } + } + [Fact] public void PopulatesClassTablesWhenIconIndexIsZero() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DecompiledNestedDirSearchUnderRegSearch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DecompiledNestedDirSearchUnderRegSearch.wxs index 8d1e5de2..b67abbde 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DecompiledNestedDirSearchUnderRegSearch.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DecompiledNestedDirSearchUnderRegSearch.wxs @@ -1,9 +1,9 @@ - + - + @@ -15,10 +15,10 @@ - + - + @@ -29,12 +29,12 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch64.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch64.wxs new file mode 100644 index 00000000..8be5abb2 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch64.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle.wxs new file mode 100644 index 00000000..78e754c1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle.wxs @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle64.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle64.wxs new file mode 100644 index 00000000..18cdfd32 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleWithApprovedExe/Bundle64.wxs @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Class/DecompiledOldClassTableDef.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Class/DecompiledOldClassTableDef.wxs index 08ced0c2..43af2ffe 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Class/DecompiledOldClassTableDef.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Class/DecompiledOldClassTableDef.wxs @@ -1,9 +1,9 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs index f87c9387..935cc8b3 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable-Expected.wxs @@ -1,4 +1,4 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs index 89592150..050adbd5 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileNullComponent/Expected.wxs @@ -1,9 +1,9 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed/Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed/Expected.wxs index e2557fe1..e1fb426e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed/Expected.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed/Expected.wxs @@ -1,9 +1,9 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed64/Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed64/Expected.wxs index 38ce54b8..fed69a1e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed64/Expected.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileSingleFileCompressed64/Expected.wxs @@ -1,9 +1,9 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SequenceTables/DecompiledSequenceTables.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SequenceTables/DecompiledSequenceTables.wxs index 08af1950..6924f37a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/SequenceTables/DecompiledSequenceTables.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SequenceTables/DecompiledSequenceTables.wxs @@ -1,10 +1,10 @@ - + - + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs index 1b602588..13412b50 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs @@ -1,9 +1,9 @@ - + - + -- cgit v1.2.3-55-g6feb