Skip to content

Commit

Permalink
Support loc strings for Directory/@shortname.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Feb 18, 2024
1 parent a38b07a commit 4f1209d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wix/WixToolset.Core/CompilerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,9 @@ public string GetAttributeShortFilename(SourceLineNumber sourceLineNumbers, XAtt

if (0 < value.Length)
{
if (!this.parseHelper.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value))
if (!this.parseHelper.IsValidShortFilename(value, allowWildcards)
&& !Common.ContainsValidBinderVariable(value)
&& !this.IsValidLocIdentifier(value))
{
this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public void PopulatesDirectoryTableWithValidDefaultDir()
"-sw1031", // this is expected for this test
Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"),
Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
"-loc", Path.Combine(folder, "DefaultDir", "Package.en-us.wxl"),
"-bindpath", Path.Combine(folder, "SingleFile", "data"),
"-intermediateFolder", intermediateFolder,
"-o", msiPath
Expand All @@ -252,6 +253,7 @@ public void PopulatesDirectoryTableWithValidDefaultDir()
"Directory:GitFolder\tINSTALLFOLDER\t69sdfw2d|.git",
"Directory:INSTALLFOLDER\tProgramFiles6432Folder\t1egc1laj|MsiPackage",
"Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName",
"Directory:NAMEANDSHORTNAMEVIALOCSTRING\tINSTALLFOLDER\tSHRTNAME|ShortName",
"Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName",
"Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL",
"Directory:ProgramFiles6432Folder\tProgramFilesFolder\t.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="DUPLICATENAMEANDSHORTNAME" Name="duplicat" ShortName="duplicat"></Directory>
<Directory Id="NAMEWITHSHORTVALUE" Name="SHORTVAL"></Directory>
<Directory Id="NAMEANDSHORTNAMEVIALOCSTRING" Name="ShortName" ShortName="!(loc.ShortVal)"></Directory>
<Directory Id="NAMEANDSHORTNAME" Name="NameAndShortName" ShortName="SHORTNAM"></Directory>
<Directory Id="SHORTNAMEONLY" Name="SHORTONL"></Directory>
<Directory Id="SOURCENAME" Name="NameAndSourceName" SourceName="SourceNameWithName"></Directory>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
<String Id="ShortVal" Value="SHRTNAME" />
</WixLocalization>

0 comments on commit 4f1209d

Please sign in to comment.