Skip to content

Commit 7e09456

Browse files
committed
windows: fix en-dash characters in installer Exec command
The powershell.exe invocation in the Installer.Windows.csproj Exec task uses Unicode en dash characters (U+2013) instead of ASCII hyphens for the -NonInteractive and -ExecutionPolicy parameters. Windows PowerShell 5.1 does not recognise en dashes as parameter prefixes, so these flags are not applied correctly, which can cause the layout step to fail or run with an unexpected execution policy. Replace the en dash characters with ASCII hyphens. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent cf66f4d commit 7e09456

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/windows/Installer.Windows/Installer.Windows.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<Message Text="Lay Out" Importance="High" />
4545
<Exec Condition="'$(NoLayout)'!='true'"
4646
ConsoleToMSBuild="true"
47-
Command="powershell.exe NonInteractive ExecutionPolicy Unrestricted -Command &quot;&amp; {&amp;'$(MSBuildProjectDirectory)\layout.ps1' -Configuration '$(Configuration)' -Output '$(PayloadPath)' -RuntimeIdentifier '$(RuntimeIdentifier)'; if ($?) { exit 0 } else { exit 1 }}&quot;"
47+
Command="powershell.exe -NonInteractive -ExecutionPolicy Unrestricted -Command &quot;&amp; {&amp;'$(MSBuildProjectDirectory)\layout.ps1' -Configuration '$(Configuration)' -Output '$(PayloadPath)' -RuntimeIdentifier '$(RuntimeIdentifier)'; if ($?) { exit 0 } else { exit 1 }}&quot;"
4848
IgnoreExitCode="true">
4949
<!-- If we want to display the console output if the exit code is not 0, we need to capture it and then output it using the <Error /> below -->
5050
<Output TaskParameter="ExitCode" PropertyName="ExitCodeOfExec" />

0 commit comments

Comments
 (0)