From 266aed497296cdb087eac157c575e95253ed67ca Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 15 Nov 2022 08:11:09 -0800 Subject: Add missing IniFile createLine handling Fixes 7009 --- src/wix/WixToolset.Core/Compiler.cs | 3 ++ .../MsiQueryFixture.cs | 33 ++++++++++++++++++++++ .../TestData/Font/FontTitle.wxs | 2 ++ .../TestData/IniFile/IniFile.wxs | 12 ++++++++ 4 files changed, 50 insertions(+) create mode 100644 src/wix/test/WixToolsetTest.CoreIntegration/TestData/IniFile/IniFile.wxs diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs index 79bb40e7..bd10fc55 100644 --- a/src/wix/WixToolset.Core/Compiler.cs +++ b/src/wix/WixToolset.Core/Compiler.cs @@ -5958,6 +5958,9 @@ namespace WixToolset.Core case "addTag": action = IniFileActionType.AddTag; break; + case "createLine": + action = IniFileActionType.CreateLine; + break; case "removeLine": action = IniFileActionType.RemoveLine; break; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index bc5f7f1d..92d6286f 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -528,6 +528,39 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void PopulatesIniFile() + { + 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, "IniFile", "IniFile.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[] { "IniFile" }); + WixAssert.CompareLineByLine(new[] + { + "IniFile:iniRVwYTVbDGRcXg7ckoDxDHV1iRaQ\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeKey\tSomeValue\t2\tIniComp", + }, results); + } + } + [Fact] public void PopulatesInstallExecuteSequenceTable() { diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Font/FontTitle.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Font/FontTitle.wxs index 6fb9ef05..ffcb9d13 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Font/FontTitle.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Font/FontTitle.wxs @@ -4,6 +4,8 @@ + + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/IniFile/IniFile.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/IniFile/IniFile.wxs new file mode 100644 index 00000000..f442beb6 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/IniFile/IniFile.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + + -- cgit v1.2.3-55-g6feb