From 458a4a5f6baf27b4f046f139d22d75f66b10ff0c Mon Sep 17 00:00:00 2001 From: Scott Munro Date: Sat, 6 Sep 2025 10:30:16 -0700 Subject: [PATCH] fix: windows nsis installer powershell executions run in -noprofile mode (#4231) --- cmake/packaging/windows_nsis.cmake | 5 +++-- src_assets/windows/misc/migration/migrate-config.bat | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/packaging/windows_nsis.cmake b/cmake/packaging/windows_nsis.cmake index 2f4f2d6cf..8ac1ce955 100644 --- a/cmake/packaging/windows_nsis.cmake +++ b/cmake/packaging/windows_nsis.cmake @@ -16,7 +16,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' nsExec::ExecToLog \ - 'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\install-gamepad.ps1\\\"' + 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\install-gamepad.ps1\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"' NoController: @@ -33,7 +33,8 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS 'Do you want to remove Virtual Gamepad?' \ /SD IDNO IDNO NoGamepad nsExec::ExecToLog \ - 'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.ps1\\\"'; \ + 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File \ + \\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.ps1\\\"'; \ skipped if no NoGamepad: MessageBox MB_YESNO|MB_ICONQUESTION \ diff --git a/src_assets/windows/misc/migration/migrate-config.bat b/src_assets/windows/misc/migration/migrate-config.bat index cc720ada6..f40083306 100644 --- a/src_assets/windows/misc/migration/migrate-config.bat +++ b/src_assets/windows/misc/migration/migrate-config.bat @@ -50,7 +50,7 @@ if exist "%OLD_DIR%\covers\" ( move "%OLD_DIR%\covers" "%NEW_DIR%\" rem Fix apps.json image path values that point at the old covers directory - powershell -c "(Get-Content '%NEW_DIR%\apps.json').replace('.\/covers\/', '.\/config\/covers\/') | Set-Content '%NEW_DIR%\apps.json'" + powershell -NoProfile -c "(Get-Content '%NEW_DIR%\apps.json').replace('.\/covers\/', '.\/config\/covers\/') | Set-Content '%NEW_DIR%\apps.json'" ) )