fix(build): properly forward script arguments when using privilege escalation on Windows
Description
Currently when launching applications requiring privilege escalation, providing more than one argument to the command line will prevent the application from launch
Steps to reproduce
- Launch any app requiring privilege escalation with more than one argument, e.g.
--clog --log-info
Functional specifications
- Fix the launch scripts for multiple arguments
Technical specifications
The following diff addressed the issue:
modified cmake/build/macros.cmake
@@ -331,7 +331,7 @@ macro(fw_exec SIGHT_TARGET)
"whoami /all | findstr S-1-16-12288 > nul\n"
"rem if we do not have those, restart the script as Admin\n"
"if %errorlevel%==1 if not \"%~1\"==\"/noadmin\" "
- "(powershell start -verb runas '%~f0' %* & exit /b)\n"
+ "(powershell Start-Process -verb runas -ArgumentList '%*' '%~f0' & exit /b)\n"
)
endif()
@@ -838,7 +838,7 @@ macro(fw_module SIGHT_TARGET TARGET_TYPE TARGET_REQUIRE_ADMIN)
"whoami /all | findstr S-1-16-12288 > nul\n"
"rem if we do not have those, restart the script as Admin\n"
"if %errorlevel%==1 if not \"%~1\"==\"/noadmin\" "
- "(powershell start -verb runas '%~f0' %* & exit /b)\n"
+ "(powershell Start-Process -verb runas -ArgumentList '%*' '%~f0' & exit /b)\n"
)
endif()
Test plan
- Manual testing