Skip to content

Commit

Permalink
Fix IniFile action values.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Mar 20, 2024
1 parent db7727a commit 03a4cf2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/api/wix/WixToolset.Data/Symbols/InifFileActionSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace WixToolset.Data.Symbols
public enum IniFileActionType
{
AddLine,
AddTag,
CreateLine,
RemoveLine,
AddTag,
RemoveTag,
}
}
}
17 changes: 15 additions & 2 deletions src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,24 @@ public void PopulatesIniFile()

result.AssertSuccess();

result = WixRunner.Execute(new[]
{
"msi",
"validate",
msiPath
});

result.AssertSuccess();

Assert.True(File.Exists(msiPath));
var results = Query.QueryDatabase(msiPath, new[] { "IniFile" });
var results = Query.QueryDatabase(msiPath, new[] { "IniFile", "RemoveIniFile" });
WixAssert.CompareLineByLine(new[]
{
"IniFile:iniRVwYTVbDGRcXg7ckoDxDHV1iRaQ\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeKey\tSomeValue\t2\tIniComp",
"IniFile:IniAddLine\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeOtherKey\tSomeOtherValue\t0\tIniComp",
"IniFile:IniAddTag\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeOtherKey\tAnotherValueEntirely\t3\tIniComp",
"IniFile:IniCreateLine\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeKey\tSomeValue\t1\tIniComp",
"RemoveIniFile:IniRemoveLine\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeKey\t\t2\tIniComp",
"RemoveIniFile:IniRemoveTag\ttest.txt\tINSTALLFOLDER\tTestSection\tSomeOtherKey\tAnotherValueEntirely\t4\tIniComp",
}, results);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
<Component Id="IniComp" Directory="INSTALLFOLDER">
<File Id="test.txt" Source="test.txt" />

<IniFile Action="createLine" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeKey" Value="SomeValue" />
<IniFile Action="createLine" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeKey" Value="SomeValue" Id="IniCreateLine" />

<IniFile Action="addLine" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeOtherKey" Value="SomeOtherValue" Id="IniAddLine" />

<IniFile Action="addTag" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeOtherKey" Value="AnotherValueEntirely" Id="IniAddTag" />

<IniFile Action="removeLine" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeKey" Id="IniRemoveLine" />

<IniFile Action="removeTag" Directory="INSTALLFOLDER" Name="test.txt" Section="TestSection" Key="SomeOtherKey" Value="AnotherValueEntirely" Id="IniRemoveTag" />
</Component>
</ComponentGroup>
</Fragment>
Expand Down

0 comments on commit 03a4cf2

Please sign in to comment.