From 062d0b1837c71497dbd2ba0b7660e7d9ea86d0df Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 26 Jan 2023 23:53:56 -0600 Subject: [PATCH 1/3] Fix silent mode install and avoid focus stealing terminal windows during regular installation --- CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 463bbf69029..d95678183e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -633,15 +633,16 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h # Install service SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} - ExecWait '\\\"$SYSDIR\\\\cmd.exe\\\" /c \\\"start https://sunshinestream.readthedocs.io/\\\"' - ExecWait 'icacls \\\"$INSTDIR\\\" /reset' - ExecWait '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' - ExecWait 'icacls \\\"$INSTDIR\\\\config\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)' - ExecWait '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' - ExecWait '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' - MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to add/update ViGEmBus (virtual controller support)?' \ - IDNO NoController - ExecWait '\\\"$SYSDIR\\\\cmd.exe\\\" /c \\\"start https://github.com/ViGEm/ViGEmBus/releases/latest\\\"'; \ + IfSilent +2 0 + ExecShell 'open' 'https://sunshinestream.readthedocs.io/' + nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' + nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\\config\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' + MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to install ViGEmBus? This is REQUIRED for gamepad support while streaming.' \ + /SD IDNO IDNO NoController + ExecShell 'open' 'https://github.com/ViGEm/ViGEmBus/releases/latest'; \ skipped if no NoController: ") @@ -650,8 +651,8 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h # Uninstall service set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} - ExecWait '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"' - ExecWait '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' MessageBox MB_YESNO|MB_ICONQUESTION \ 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ /SD IDNO IDNO NoDelete From 68e542191dc0df9d2acf75c97d60cbd8e2291f08 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 27 Jan 2023 00:08:18 -0600 Subject: [PATCH 2/3] Rename Sunshine shortcut to try to avoid confusion with service mode --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d95678183e7..e614c342b61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -668,12 +668,12 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") set(CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA} - CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \ + CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME} (Foreground Mode).lnk' \ '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' ") set(CPACK_NSIS_DELETE_ICONS_EXTRA "${CPACK_NSIS_DELETE_ICONS_EXTRA} - Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk' + Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME} (Foreground Mode).lnk' ") # Checking for previous installed versions From 852608ee074683975a0cd828603a51efd39ad2df Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 27 Jan 2023 00:20:56 -0600 Subject: [PATCH 3/3] Fix CMake linter warning --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e614c342b61..df339906db5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -640,7 +640,8 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\\config\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' - MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to install ViGEmBus? This is REQUIRED for gamepad support while streaming.' \ + MessageBox MB_YESNO|MB_ICONQUESTION \ + 'Do you want to install ViGEmBus? This is REQUIRED for gamepad support while streaming.' \ /SD IDNO IDNO NoController ExecShell 'open' 'https://github.com/ViGEm/ViGEmBus/releases/latest'; \ skipped if no