From 57559c253fe8ec6f9c66662d11fbcabccc3ba057 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 6 Feb 2020 22:04:55 -0500 Subject: Add CreateFolder tuples for null-keypath components in the backend instead of the compiler. --- .../MsiQueryFixture.cs | 33 ++++++++++++++++++++++ .../TestData/Components/Package.en-us.wxl | 11 ++++++++ .../TestData/Components/Package.wxs | 21 ++++++++++++++ .../TestData/Components/PackageComponents.wxs | 10 +++++++ .../TestData/Components/data/test.txt | 1 + .../WixToolsetTest.CoreIntegration.csproj | 4 +++ 6 files changed, 80 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Components/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt (limited to 'src/test') diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 38ef2e2e..6fd02d5f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -252,6 +252,39 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void PopulatesCreateFolderTableForNullKeypathComponents() + { + var folder = TestData.Get(@"TestData\Components"); + + 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, "Package.wxs"), + Path.Combine(folder, "PackageComponents.wxs"), + "-loc", Path.Combine(folder, "Package.en-us.wxl"), + "-bindpath", Path.Combine(folder, "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(msiPath)); + var results = Query.QueryDatabase(msiPath, new[] { "CreateFolder" }); + Assert.Equal(new[] + { + "CreateFolder:INSTALLFOLDER\tNullKeypathComponent", + }, results); + } + } + [Fact] public void PopulatesCustomActionTable() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.wxs new file mode 100644 index 00000000..6da3dcbe --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/PackageComponents.wxs new file mode 100644 index 00000000..beaf70bf --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Components/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index b17a27ff..a64ff93d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -156,6 +156,10 @@ + + + + -- cgit v1.2.3-55-g6feb