Skip to content

[Dev] Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation#45927

Draft
snickler wants to merge 19 commits intomainfrom
dev/snickler/fix-resw-script
Draft

[Dev] Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation#45927
snickler wants to merge 19 commits intomainfrom
dev/snickler/fix-resw-script

Conversation

@snickler
Copy link
Collaborator

@snickler snickler commented Mar 4, 2026

Summary of the Pull Request

Adds single-quote wrapping around the PowerShell script path and the $(MSBuildThisFileDirectory) parameter in every GenerateResourceFiles MSBuild target across the solution. Without quoting, the Exec command 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.ps1 like:

<!-- Before -->
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) ..." />

<!-- After -->
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; ..." />

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: No behavioral changes; build-time script quoting fix only. Verified locally that affected projects build correctly.
  • Localization: No user-facing strings changed
  • Dev docs: No doc changes needed
  • New binaries: N/A

Detailed Description of the Pull Request / Additional comments

The GenerateResourceFiles MSBuild <Exec> commands in 29 .vcxproj files 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:

  • ActionRunner
  • Update
  • AdvancedPaste
  • AlwaysOnTop
  • ColorPicker
  • EnvironmentVariables
  • FancyZones
  • FileLocksmith (ContextMenu & Ext)
  • Hosts
  • ImageResizer (ContextMenu & dll)
  • KeyboardManager (Editor, EditorLibrary, dll)
  • Launcher
  • NewPlus (win10 & main)
  • PowerOCR
  • PowerRename (ContextMenu & dll)
  • PreviewPane (Markdown & powerpreview)
  • Runner
  • ShortcutGuide (ShortcutGuide & ModuleInterface)
  • Workspaces (Launcher, SnapshotTool, WindowArranger)

Validation Steps Performed

  • Built affected modules locally with a path containing spaces; GenerateResourceFiles target now completes without error.
  • Confirmed generated .rc / .h resource files are produced correctly.

Copilot AI review requested due to automatic review settings March 4, 2026 23:35
@snickler snickler changed the title Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation [Dev] Fix GenerateResourceFiles task: add path quoting to handle spaces in convert-resx-to-rc.ps1 invocation Mar 4, 2026
@snickler snickler enabled auto-merge (squash) March 4, 2026 23:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.vcxproj around 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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(SolutionDir)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h WorkspacesLauncherResource.base.rc WorkspacesLauncherResource.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(SolutionDir)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h WorkspacesSnapshotToolResources.base.rc WorkspacesSnapshotToolResources.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h PowerRenameExt.base.rc PowerRenameExt.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;..\..\..\..\tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h new.base.rc new.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h PowerOCR.base.rc PowerOCR.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h ShortcutGuide.base.rc ShortcutGuide.rc" />

Copilot uses AI. Check for mistakes.
<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" />
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &quot; in XML) or switch to powershell -File with properly quoted arguments instead of wrapping these in single quotes.

Suggested change
<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 &quot;$(RepoRoot)tools\build\convert-resx-to-rc.ps1&quot; &quot;$(MSBuildThisFileDirectory)&quot; resource.base.h resource.h Microsoft.Launcher.base.rc Microsoft.Launcher.rc" />

Copilot uses AI. Check for mistakes.
@snickler snickler force-pushed the dev/snickler/fix-resw-script branch 2 times, most recently from c5db0a2 to 97919d7 Compare March 5, 2026 00:02
@snickler snickler requested a review from Copilot March 5, 2026 00:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

@snickler snickler marked this pull request as draft March 5, 2026 00:42
auto-merge was automatically disabled March 5, 2026 00:42

Pull request was converted to draft

snickler added 18 commits March 4, 2026 19:47
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.
@snickler snickler force-pushed the dev/snickler/fix-resw-script branch from 97919d7 to a82013e Compare March 5, 2026 00:50
Add single quotes around script path and directory parameters to handle
paths with spaces in convert-resx-to-rc.ps1 invocation.
@snickler snickler force-pushed the dev/snickler/fix-resw-script branch from a82013e to 987affd Compare March 5, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants