[Dev] Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation#45927
[Dev] Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation#45927
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make the MSBuild GenerateResourceFiles targets resilient to repo paths containing spaces by adding quoting around the convert-resx-to-rc.ps1 script path and the project directory argument across multiple .vcxproj files.
Changes:
- Updated
GenerateResourceFiles<Exec>commands to wrap the PowerShell script path in quotes. - Updated
GenerateResourceFiles<Exec>commands to wrap the directory argument ($(MSBuildThisFileDirectory)or variants) in quotes. - (Incidental) Normalized formatting/line endings in
KeyboardManager.vcxprojaround the edited region.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 29 comments.
Show a summary per file
| File | Description |
|---|---|
| src/runner/runner.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/previewpane/powerpreview/powerpreview.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/previewpane/MarkdownPreviewHandlerCpp/MarkdownPreviewHandlerCpp.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/powerrename/dll/PowerRenameExt.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/powerrename/PowerRenameContextMenu/PowerRenameContextMenu.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/keyboardmanager/dll/KeyboardManager.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/keyboardmanager/KeyboardManagerEditorLibrary/KeyboardManagerEditorLibrary.vcxproj | Quote PowerShell script + editor directory arg in GenerateResourceFiles. |
| src/modules/keyboardmanager/KeyboardManagerEditor/KeyboardManagerEditor.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/imageresizer/dll/ImageResizerExt.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/fancyzones/FancyZonesLib/FancyZonesLib.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/colorPicker/ColorPicker/ColorPicker.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/alwaysontop/AlwaysOnTop/AlwaysOnTop.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/Workspaces/WorkspacesWindowArranger/WorkspacesWindowArranger.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/Workspaces/WorkspacesSnapshotTool/WorkspacesSnapshotTool.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/Workspaces/WorkspacesLauncher/WorkspacesLauncher.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/ShortcutGuide/ShortcutGuideModuleInterface/ShortcutGuideModuleInterface.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/ShortcutGuide/ShortcutGuide/ShortcutGuide.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/PowerOCR/PowerOCRModuleInterface/PowerOCRModuleInterface.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/NewPlus/NewShellExtensionContextMenu.win10/NewPlus.ShellExtension.win10.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/NewPlus/NewShellExtensionContextMenu/NewShellExtensionContextMenu.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/Hosts/HostsModuleInterface/HostsModuleInterface.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/modules/AdvancedPaste/AdvancedPasteModuleInterface/AdvancedPasteModuleInterface.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/Update/PowerToys.Update.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| src/ActionRunner/actionRunner.vcxproj | Quote PowerShell script + directory args in GenerateResourceFiles. |
| <Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h WorkspacesLauncherResource.base.rc WorkspacesLauncherResource.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(SolutionDir)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h WorkspacesLauncherResource.base.rc WorkspacesLauncherResource.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(SolutionDir)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h WorkspacesLauncherResource.base.rc WorkspacesLauncherResource.rc" /> | |
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted -File "$(SolutionDir)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h WorkspacesLauncherResource.base.rc WorkspacesLauncherResource.rc" /> |
| <Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h WorkspacesSnapshotToolResources.base.rc WorkspacesSnapshotToolResources.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(SolutionDir)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h WorkspacesSnapshotToolResources.base.rc WorkspacesSnapshotToolResources.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(SolutionDir)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h WorkspacesSnapshotToolResources.base.rc WorkspacesSnapshotToolResources.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(SolutionDir)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h WorkspacesSnapshotToolResources.base.rc WorkspacesSnapshotToolResources.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h PowerRenameExt.base.rc PowerRenameExt.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerRenameExt.base.rc PowerRenameExt.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerRenameExt.base.rc PowerRenameExt.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h PowerRenameExt.base.rc PowerRenameExt.rc" /> |
src/Update/PowerToys.Update.vcxproj
Outdated
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted ..\..\..\..\tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '..\..\..\..\tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '..\..\..\..\tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" /> | |
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted -File "..\..\..\..\tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h new.base.rc new.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h new.base.rc new.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h new.base.rc new.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h new.base.rc new.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h PowerOCR.base.rc PowerOCR.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerOCR.base.rc PowerOCR.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerOCR.base.rc PowerOCR.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Bypass -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h PowerOCR.base.rc PowerOCR.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h ShortcutGuide.base.rc ShortcutGuide.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h ShortcutGuide.base.rc ShortcutGuide.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h ShortcutGuide.base.rc ShortcutGuide.rc" /> | |
| <Exec Command="powershell -NonInteractive -ExecutionPolicy Unrestricted -File "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h ShortcutGuide.base.rc ShortcutGuide.rc" /> |
| <Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
| <Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h Microsoft.Launcher.base.rc Microsoft.Launcher.rc" /> | ||
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h Microsoft.Launcher.base.rc Microsoft.Launcher.rc" /> |
There was a problem hiding this comment.
Exec runs through cmd.exe, where single quotes are not treated as quoting characters. This means PowerShell receives the script path and $(MSBuildThisFileDirectory) with literal ' characters, so the script won’t be found / the directory argument will be wrong. Use double quotes (escaped as " in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h Microsoft.Launcher.base.rc Microsoft.Launcher.rc" /> | |
| <Exec Command="powershell -NonInteractive -executionpolicy Unrestricted "$(RepoRoot)tools\build\convert-resx-to-rc.ps1" "$(MSBuildThisFileDirectory)" resource.base.h resource.h Microsoft.Launcher.base.rc Microsoft.Launcher.rc" /> |
c5db0a2 to
97919d7
Compare
Pull request was converted to draft
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
…ting Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
97919d7 to
a82013e
Compare
Add single quotes around script path and directory parameters to handle paths with spaces in convert-resx-to-rc.ps1 invocation.
a82013e to
987affd
Compare
Summary of the Pull Request
Adds single-quote wrapping around the PowerShell script path and the
$(MSBuildThisFileDirectory)parameter in everyGenerateResourceFilesMSBuild target across the solution. Without quoting, theExeccommand silently fails (or produces incorrect results) when the repository is checked out under a path that contains spaces.The affected targets all invoke
convert-resx-to-rc.ps1like:PR Checklist
Detailed Description of the Pull Request / Additional comments
The
GenerateResourceFilesMSBuild<Exec>commands in 29.vcxprojfiles were passing the PowerShell script path and the project directory path as unquoted arguments. PowerShell treats spaces as argument separators, so any path segment containing a space caused the script invocation to break.Affected projects:
Validation Steps Performed
GenerateResourceFilestarget now completes without error..rc/.hresource files are produced correctly.