Support loc strings for Directory/@ShortName.
Fixes https://github.com/wixtoolset/issues/issues/7935.
Bob Arnson committed
Feb 17, 2024 at 18:48 UTC
4f1209d8e795ddeb4c639c96081bcfebbfa8e1e2
4 files changed
+10
-1
src/wix/WixToolset.Core/CompilerCore.cs
+3
-1
@@ -703,7 +703,9 @@ namespace WixToolset.Core
703
704
if (0 < value.Length)
705
{
706
- if (!this.parseHelper.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value))
706
+ if (!this.parseHelper.IsValidShortFilename(value, allowWildcards)
707
+ && !Common.ContainsValidBinderVariable(value)
708
+ && !this.IsValidLocIdentifier(value))
709
{
710
this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value));
711
}
src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+2
@@ -233,6 +233,7 @@ namespace WixToolsetTest.CoreIntegration
233
"-sw1031", // this is expected for this test
234
Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"),
235
Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
236
+ "-loc", Path.Combine(folder, "DefaultDir", "Package.en-us.wxl"),
237
"-bindpath", Path.Combine(folder, "SingleFile", "data"),
238
"-intermediateFolder", intermediateFolder,
239
"-o", msiPath
@@ -252,6 +253,7 @@ namespace WixToolsetTest.CoreIntegration
253
"Directory:GitFolder\tINSTALLFOLDER\t69sdfw2d|.git",
254
"Directory:INSTALLFOLDER\tProgramFiles6432Folder\t1egc1laj|MsiPackage",
255
"Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName",
256
+ "Directory:NAMEANDSHORTNAMEVIALOCSTRING\tINSTALLFOLDER\tSHRTNAME|ShortName",
257
"Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName",
258
"Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL",
259
"Directory:ProgramFiles6432Folder\tProgramFilesFolder\t.",
src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs
+1
@@ -10,6 +10,7 @@
10
<DirectoryRef Id="INSTALLFOLDER">
11
<Directory Id="DUPLICATENAMEANDSHORTNAME" Name="duplicat" ShortName="duplicat"></Directory>
12
<Directory Id="NAMEWITHSHORTVALUE" Name="SHORTVAL"></Directory>
13
+ <Directory Id="NAMEANDSHORTNAMEVIALOCSTRING" Name="ShortName" ShortName="!(loc.ShortVal)"></Directory>
14
<Directory Id="NAMEANDSHORTNAME" Name="NameAndShortName" ShortName="SHORTNAM"></Directory>
15
<Directory Id="SHORTNAMEONLY" Name="SHORTONL"></Directory>
16
<Directory Id="SOURCENAME" Name="NameAndSourceName" SourceName="SourceNameWithName"></Directory>
src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/Package.en-us.wxl
new
+4
@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
3
+ <String Id="ShortVal" Value="SHRTNAME" />
4
+</WixLocalization>