Fix dotnet.exe path quoting in wix.targets#16381
Conversation
The Exec command in GenerateVSInsertionNupkgCore target was not quoting the DotNetTool variable, causing failures when dotnet.exe is installed in a path with spaces (e.g., 'C:\Program Files\dotnet\dotnet.exe'). This resulted in the error: 'C:\Program' is not recognized as an internal or external command. Added proper quoting around the DotNetTool variable to fix the issue.
There was a problem hiding this comment.
Pull request overview
This PR fixes a build failure in the WiX 5 installer build targets that occurred when the .NET SDK (dotnet.exe) is installed in a path containing spaces. The fix adds proper quoting around the $(DotNetTool) variable in the Exec command within the GenerateVSInsertionNupkgCore target.
Key Changes:
- Added quotes around
$(DotNetTool)variable in the Exec command to handle paths with spaces (e.g., "C:\Program Files\dotnet\dotnet.exe")
|
Looked for other instances -- https://github.com/search?q=repo%3Adotnet%2Farcade+%2FCommand.*%5C%24%5C%28DotNetTool%5C%29%2F+language%3AXML&type=code Seems Wix is the only case. There is one that wasn't fixed in this PR, but might be in dead code as it's for old wix |
|
Here's a search for other instances across the dotnet org -- https://github.com/search?q=org%3Adotnet+%2FCommand.*%5C%24%5C%28DotNetTool%5C%29%5B%5E%22%26%5D%2F+language%3AXML&type=code |
Fixes an issue where Exec commands were not quoting the DotNetTool variable, causing build failures when dotnet.exe is installed in a path with spaces (e.g., 'C:\Program Files\dotnet\dotnet.exe'). This applies the same fix from dotnet/arcade#16381 to all occurrences in the dotnet/dotnet repository. Changed Command="$(DotNetTool) ..." to Command=""$(DotNetTool)" ..." in: - src/diagnostics/src/SOS/SOS.Package/SOS.Package.csproj - src/runtime/src/mono/sample/Android/AndroidSampleApp.csproj - src/sdk/src/Layout/redist/targets/OverlaySdkOnLKG.targets - src/arcade wix/wix.targets and wix5/wix.targets - repo-projects/Directory.Build.targets - 8 files in src/source-build-reference-packages/src/externalPackages/projects/
Fixes an issue where the Exec command in GenerateVSInsertionNupkgCore target was not quoting the DotNetTool variable, causing build failures when dotnet.exe is installed in a path with spaces. Added proper quoting around the DotNetTool variable in the Exec command.