Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IniFile action values. #511

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
}
}
}
2 changes: 1 addition & 1 deletion src/api/wix/WixToolset.Data/WarningMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public static Message RetainRangeMismatch(SourceLineNumber sourceLineNumbers, st

public static Message ServiceConfigFamilyNotSupported(SourceLineNumber sourceLineNumbers, string elementName)
{
return Message(sourceLineNumbers, Ids.ServiceConfigFamilyNotSupported, "{0} functionality is documented in the Windows Installer SDK to \"not [work] as expected.\" Consider replacing {0} with the WixUtilExtension ServiceConfig element.", elementName);
return Message(sourceLineNumbers, Ids.ServiceConfigFamilyNotSupported, "{0} functionality is documented in the Windows Installer SDK to \"not [work] as expected.\" Consider replacing {0} with the WixToolset.Util.wixext ServiceConfig element.", elementName);
}

public static Message SkippingMergeModuleTable(SourceLineNumber sourceLineNumbers, string tableName)
Expand Down
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
Loading