Skip to content

Commit 458a4a5

Browse files
authored
fix: windows nsis installer powershell executions run in -noprofile mode (#4231)
1 parent 8bff4d0 commit 458a4a5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmake/packaging/windows_nsis.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
1616
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"'
1717
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
1818
nsExec::ExecToLog \
19-
'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\install-gamepad.ps1\\\"'
19+
'powershell.exe -NoProfile -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\install-gamepad.ps1\\\"'
2020
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
2121
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"'
2222
NoController:
@@ -33,7 +33,8 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
3333
'Do you want to remove Virtual Gamepad?' \
3434
/SD IDNO IDNO NoGamepad
3535
nsExec::ExecToLog \
36-
'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.ps1\\\"'; \
36+
'powershell.exe -NoProfile -ExecutionPolicy Bypass -File \
37+
\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.ps1\\\"'; \
3738
skipped if no
3839
NoGamepad:
3940
MessageBox MB_YESNO|MB_ICONQUESTION \

src_assets/windows/misc/migration/migrate-config.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if exist "%OLD_DIR%\covers\" (
5050
move "%OLD_DIR%\covers" "%NEW_DIR%\"
5151

5252
rem Fix apps.json image path values that point at the old covers directory
53-
powershell -c "(Get-Content '%NEW_DIR%\apps.json').replace('.\/covers\/', '.\/config\/covers\/') | Set-Content '%NEW_DIR%\apps.json'"
53+
powershell -NoProfile -c "(Get-Content '%NEW_DIR%\apps.json').replace('.\/covers\/', '.\/config\/covers\/') | Set-Content '%NEW_DIR%\apps.json'"
5454
)
5555
)
5656

0 commit comments

Comments
 (0)