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

Support loc strings for Directory/@ShortName. #494

Merged
merged 1 commit into from
Feb 18, 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: 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>
Loading