aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-11-15 08:11:09 -0800
committerRob Mensching <rob@firegiant.com>2022-11-15 22:04:07 -0800
commit266aed497296cdb087eac157c575e95253ed67ca (patch)
treea47034bade3430882b205ffa2a171222f570b2d3
parent5b208b133e6970f4af247b7d13bd198637b4552b (diff)
downloadwix-266aed497296cdb087eac157c575e95253ed67ca.tar.gz
wix-266aed497296cdb087eac157c575e95253ed67ca.tar.bz2
wix-266aed497296cdb087eac157c575e95253ed67ca.zip
Add missing IniFile createLine handling
Fixes 7009
-rw-r--r--src/wix/WixToolset.Core/Compiler.cs3
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs33
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/Font/FontTitle.wxs2
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/IniFile/IniFile.wxs12
4 files changed, 50 insertions, 0 deletions
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
5958 case "addTag": 5958 case "addTag":
5959 action = IniFileActionType.AddTag; 5959 action = IniFileActionType.AddTag;
5960 break; 5960 break;
5961 case "createLine":
5962 action = IniFileActionType.CreateLine;
5963 break;
5961 case "removeLine": 5964 case "removeLine":
5962 action = IniFileActionType.RemoveLine; 5965 action = IniFileActionType.RemoveLine;
5963 break; 5966 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
@@ -529,6 +529,39 @@ namespace WixToolsetTest.CoreIntegration
529 } 529 }
530 530
531 [Fact] 531 [Fact]
532 public void PopulatesIniFile()
533 {
534 var folder = TestData.Get(@"TestData");
535
536 using (var fs = new DisposableFileSystem())
537 {
538 var baseFolder = fs.GetFolder();
539 var intermediateFolder = Path.Combine(baseFolder, "obj");
540 var msiPath = Path.Combine(baseFolder, @"bin", "test.msi");
541
542 var result = WixRunner.Execute(new[]
543 {
544 "build",
545 Path.Combine(folder, "IniFile", "IniFile.wxs"),
546 Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
547 Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
548 "-bindpath", Path.Combine(folder, "SingleFile", "data"),
549 "-intermediateFolder", intermediateFolder,
550 "-o", msiPath
551 });
552
553 result.AssertSuccess();
554
555 Assert.True(File.Exists(msiPath));
556 var results = Query.QueryDatabase(msiPath, new[] { "IniFile" });
557 WixAssert.CompareLineByLine(new[]
558 {
559 "IniFile:iniRVwYTVbDGRcXg7ckoDxDHV1iRaQ\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeKey\tSomeValue\t2\tIniComp",
560 }, results);
561 }
562 }
563
564 [Fact]
532 public void PopulatesInstallExecuteSequenceTable() 565 public void PopulatesInstallExecuteSequenceTable()
533 { 566 {
534 var folder = TestData.Get(@"TestData"); 567 var folder = TestData.Get(@"TestData");
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 @@
4 <ComponentGroup Id="ProductComponents"> 4 <ComponentGroup Id="ProductComponents">
5 <Component Id="FontComp" Directory="INSTALLFOLDER"> 5 <Component Id="FontComp" Directory="INSTALLFOLDER">
6 <File Id="test.txt" Source="test.txt" FontTitle="FakeFont" /> 6 <File Id="test.txt" Source="test.txt" FontTitle="FakeFont" />
7
8 <IniFile Id="SetLicenseKey" Action="createLine" Directory="ConfigurationFolder" Name="filename.conf" Section="Connectivity" Key="License" Value="1234" />
7 </Component> 9 </Component>
8 </ComponentGroup> 10 </ComponentGroup>
9 </Fragment> 11 </Fragment>
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 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <ComponentGroup Id="ProductComponents">
5 <Component Id="IniComp" Directory="INSTALLFOLDER">
6 <File Id="test.txt" Source="test.txt" />
7
8 <IniFile Action="createLine" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeKey" Value="SomeValue" />
9 </Component>
10 </ComponentGroup>
11 </Fragment>
12</Wix>