aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2024-02-17 18:48:59 -0500
committerBob Arnson <github@bobs.org>2024-02-17 19:32:22 -0500
commit4f1209d8e795ddeb4c639c96081bcfebbfa8e1e2 (patch)
tree76ea5c5df203800c989bcae1d6d6f924144f9ece
parenta38b07af45eb36cc13fcd2546ac45e6f769e4d6f (diff)
downloadwix-4f1209d8e795ddeb4c639c96081bcfebbfa8e1e2.tar.gz
wix-4f1209d8e795ddeb4c639c96081bcfebbfa8e1e2.tar.bz2
wix-4f1209d8e795ddeb4c639c96081bcfebbfa8e1e2.zip
Support loc strings for Directory/@ShortName.
Fixes https://github.com/wixtoolset/issues/issues/7935.
-rw-r--r--src/wix/WixToolset.Core/CompilerCore.cs4
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs2
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs1
-rw-r--r--src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/Package.en-us.wxl4
4 files changed, 10 insertions, 1 deletions
diff --git a/src/wix/WixToolset.Core/CompilerCore.cs b/src/wix/WixToolset.Core/CompilerCore.cs
index b01f8670..8d1c7e0a 100644
--- a/src/wix/WixToolset.Core/CompilerCore.cs
+++ b/src/wix/WixToolset.Core/CompilerCore.cs
@@ -703,7 +703,9 @@ namespace WixToolset.Core
703 703
704 if (0 < value.Length) 704 if (0 < value.Length)
705 { 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))
707 { 709 {
708 this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); 710 this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value));
709 } 711 }
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index 945e2133..b1d2955b 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -233,6 +233,7 @@ namespace WixToolsetTest.CoreIntegration
233 "-sw1031", // this is expected for this test 233 "-sw1031", // this is expected for this test
234 Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"), 234 Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"),
235 Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), 235 Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
236 "-loc", Path.Combine(folder, "DefaultDir", "Package.en-us.wxl"),
236 "-bindpath", Path.Combine(folder, "SingleFile", "data"), 237 "-bindpath", Path.Combine(folder, "SingleFile", "data"),
237 "-intermediateFolder", intermediateFolder, 238 "-intermediateFolder", intermediateFolder,
238 "-o", msiPath 239 "-o", msiPath
@@ -252,6 +253,7 @@ namespace WixToolsetTest.CoreIntegration
252 "Directory:GitFolder\tINSTALLFOLDER\t69sdfw2d|.git", 253 "Directory:GitFolder\tINSTALLFOLDER\t69sdfw2d|.git",
253 "Directory:INSTALLFOLDER\tProgramFiles6432Folder\t1egc1laj|MsiPackage", 254 "Directory:INSTALLFOLDER\tProgramFiles6432Folder\t1egc1laj|MsiPackage",
254 "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", 255 "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName",
256 "Directory:NAMEANDSHORTNAMEVIALOCSTRING\tINSTALLFOLDER\tSHRTNAME|ShortName",
255 "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", 257 "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName",
256 "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", 258 "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL",
257 "Directory:ProgramFiles6432Folder\tProgramFilesFolder\t.", 259 "Directory:ProgramFiles6432Folder\tProgramFilesFolder\t.",
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs
index 298b6c54..06ccbea4 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs
@@ -10,6 +10,7 @@
10 <DirectoryRef Id="INSTALLFOLDER"> 10 <DirectoryRef Id="INSTALLFOLDER">
11 <Directory Id="DUPLICATENAMEANDSHORTNAME" Name="duplicat" ShortName="duplicat"></Directory> 11 <Directory Id="DUPLICATENAMEANDSHORTNAME" Name="duplicat" ShortName="duplicat"></Directory>
12 <Directory Id="NAMEWITHSHORTVALUE" Name="SHORTVAL"></Directory> 12 <Directory Id="NAMEWITHSHORTVALUE" Name="SHORTVAL"></Directory>
13 <Directory Id="NAMEANDSHORTNAMEVIALOCSTRING" Name="ShortName" ShortName="!(loc.ShortVal)"></Directory>
13 <Directory Id="NAMEANDSHORTNAME" Name="NameAndShortName" ShortName="SHORTNAM"></Directory> 14 <Directory Id="NAMEANDSHORTNAME" Name="NameAndShortName" ShortName="SHORTNAM"></Directory>
14 <Directory Id="SHORTNAMEONLY" Name="SHORTONL"></Directory> 15 <Directory Id="SHORTNAMEONLY" Name="SHORTONL"></Directory>
15 <Directory Id="SOURCENAME" Name="NameAndSourceName" SourceName="SourceNameWithName"></Directory> 16 <Directory Id="SOURCENAME" Name="NameAndSourceName" SourceName="SourceNameWithName"></Directory>
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/Package.en-us.wxl b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/Package.en-us.wxl
new file mode 100644
index 00000000..e5e1db00
--- /dev/null
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/Package.en-us.wxl
@@ -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>