@joebigelow / wix / commits / 6f399719

Fix build of outputs with comma in their filename

Fixes 7343

Rob Mensching committed Apr 4, 2023 at 13:17 UTC 6f3997198d894d60afce07bd6a68bcad5fd20ba0
4 files changed +58 -1
src/wix/WixToolset.Sdk/tools/wix.targets
+1 -1
@@ -904,7 +904,7 @@
904 </ReadTracking>
905
906 <ItemGroup>
907 - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.FullPath)))" />
907 + <_RelativePath Include="$([MSBuild]::MakeRelative(&quot;$(FullIntermediateOutputPath)&quot;, &quot;%(_FullPathToCopy.FullPath)&quot;))" />
908 </ItemGroup>
909
910 <Copy
src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs
+34
@@ -818,6 +818,40 @@ namespace WixToolsetTest.Sdk
818 }
819 }
820
821 + [Theory]
822 + [InlineData(BuildSystem.DotNetCoreSdk)]
823 + [InlineData(BuildSystem.MSBuild)]
824 + [InlineData(BuildSystem.MSBuild64)]
825 + public void CanBuildPackageWithComma(BuildSystem buildSystem)
826 + {
827 + var sourceFolder = TestData.Get(@"TestData", "PackageWith,Comma");
828 +
829 + using (var fs = new TestDataFolderFileSystem())
830 + {
831 + fs.Initialize(sourceFolder);
832 + var baseFolder = fs.BaseFolder;
833 + var binFolder = Path.Combine(baseFolder, @"bin\");
834 + var projectPath = Path.Combine(baseFolder, "PackageWith,Comma.wixproj");
835 +
836 + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[]
837 + {
838 + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath),
839 + });
840 + result.AssertSuccess();
841 +
842 + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
843 + .Select(s => s.Substring(baseFolder.Length + 1))
844 + .OrderBy(s => s)
845 + .ToArray();
846 + WixAssert.CompareLineByLine(new[]
847 + {
848 + @"bin\Release\cab1.cab",
849 + @"bin\Release\PackageWith,Comma.msi",
850 + @"bin\Release\PackageWith,Comma.wixpdb",
851 + }, paths);
852 + }
853 + }
854 +
855 [Theory(Skip = "Depends on creating broken publish which is not supported at this time")]
856 [InlineData(BuildSystem.DotNetCoreSdk)]
857 [InlineData(BuildSystem.MSBuild)]
src/wix/test/WixToolsetTest.Sdk/TestData/PackageWith,Comma/Package.wxs new
+17
@@ -0,0 +1,17 @@
1 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2 + <Package Name="Package With Comma" Version="1" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
3 + <MajorUpgrade DowngradeErrorMessage="Downgrade message" />
4 +
5 + <Feature Id="ProductFeature">
6 + <Component Directory="INSTALLFOLDER">
7 + <File Source="Package.wxs" />
8 + </Component>
9 + </Feature>
10 + </Package>
11 +
12 + <Fragment>
13 + <StandardDirectory Id="ProgramFiles6432Folder">
14 + <Directory Id="INSTALLFOLDER" Name="MsiPackage" />
15 + </StandardDirectory>
16 + </Fragment>
17 +</Wix>
src/wix/test/WixToolsetTest.Sdk/TestData/PackageWith,Comma/PackageWith,Comma.wixproj new
+6
@@ -0,0 +1,6 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Project DefaultTargets="Build">
3 + <Import Project="$(WixMSBuildProps)" />
4 +
5 + <Import Project="$(WixTargetsPath)" />
6 +</Project>