|
1 | 1 | # windows specific packaging |
2 | | - |
3 | | -# see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html |
4 | 2 | install(TARGETS sunshine RUNTIME DESTINATION "." COMPONENT application) |
5 | 3 |
|
6 | 4 | # Hardening: include zlib1.dll (loaded via LoadLibrary() in openssl's libcrypto.a) |
@@ -52,79 +50,11 @@ cmake_path(CONVERT "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/shaders" |
52 | 50 | cmake_path(CONVERT "${CMAKE_BINARY_DIR}/assets/shaders" TO_NATIVE_PATH_LIST shaders_in_build_dest_native) |
53 | 51 | execute_process(COMMAND cmd.exe /c mklink /J "${shaders_in_build_dest_native}" "${shaders_in_build_src_native}") |
54 | 52 |
|
55 | | -# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp |
56 | 53 | set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\sunshine.ico") |
57 | | -set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") |
| 54 | + |
58 | 55 | # The name of the directory that will be created in C:/Program files/ |
59 | 56 | set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") |
60 | 57 |
|
61 | | -# Extra install commands |
62 | | -# Restores permissions on the install directory |
63 | | -# Migrates config files from the root into the new config folder |
64 | | -# Install service |
65 | | -SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS |
66 | | - "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} |
67 | | - IfSilent +2 0 |
68 | | - ExecShell 'open' 'https://docs.lizardbyte.dev/projects/sunshine' |
69 | | - nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' |
70 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" add' |
71 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' |
72 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' |
73 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"' |
74 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' |
75 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"' |
76 | | - NoController: |
77 | | - ") |
78 | | - |
79 | | -# Extra uninstall commands |
80 | | -# Uninstall service |
81 | | -set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS |
82 | | - "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} |
83 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"' |
84 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' |
85 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" --restore-nvprefs-undo' |
86 | | - MessageBox MB_YESNO|MB_ICONQUESTION \ |
87 | | - 'Do you want to remove Virtual Gamepad?' \ |
88 | | - /SD IDNO IDNO NoGamepad |
89 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.bat\\\"'; skipped if no |
90 | | - NoGamepad: |
91 | | - MessageBox MB_YESNO|MB_ICONQUESTION \ |
92 | | - 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ |
93 | | - /SD IDNO IDNO NoDelete |
94 | | - RMDir /r \\\"$INSTDIR\\\"; skipped if no |
95 | | - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" remove' |
96 | | - NoDelete: |
97 | | - ") |
98 | | - |
99 | | -# Adding an option for the start menu |
100 | | -set(CPACK_NSIS_MODIFY_PATH OFF) |
101 | | -set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") |
102 | | -# This will be shown on the installed apps Windows settings |
103 | | -set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") |
104 | | -set(CPACK_NSIS_CREATE_ICONS_EXTRA |
105 | | - "${CPACK_NSIS_CREATE_ICONS_EXTRA} |
106 | | - SetOutPath '\$INSTDIR' |
107 | | - CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \ |
108 | | - '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' '--shortcut' |
109 | | - ") |
110 | | -set(CPACK_NSIS_DELETE_ICONS_EXTRA |
111 | | - "${CPACK_NSIS_DELETE_ICONS_EXTRA} |
112 | | - Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk' |
113 | | - ") |
114 | | - |
115 | | -# Checking for previous installed versions |
116 | | -set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") |
117 | | - |
118 | | -set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html") |
119 | | -set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}") |
120 | | -set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support") |
121 | | - |
122 | | -set(CPACK_NSIS_MENU_LINKS |
123 | | - "https://docs.lizardbyte.dev/projects/sunshine" "Sunshine documentation" |
124 | | - "https://app.lizardbyte.dev" "LizardByte Web Site" |
125 | | - "https://app.lizardbyte.dev/support" "LizardByte Support") |
126 | | -set(CPACK_NSIS_MANIFEST_DPI_AWARE true) |
127 | | - |
128 | 58 | # Setting components groups and dependencies |
129 | 59 | set(CPACK_COMPONENT_GROUP_CORE_EXPANDED true) |
130 | 60 |
|
@@ -165,3 +95,7 @@ set(CPACK_COMPONENT_FIREWALL_GROUP "Scripts") |
165 | 95 | set(CPACK_COMPONENT_GAMEPAD_DISPLAY_NAME "Virtual Gamepad") |
166 | 96 | set(CPACK_COMPONENT_GAMEPAD_DESCRIPTION "Scripts to install and uninstall Virtual Gamepad.") |
167 | 97 | set(CPACK_COMPONENT_GAMEPAD_GROUP "Scripts") |
| 98 | + |
| 99 | +# include specific packaging |
| 100 | +include(${CMAKE_MODULE_PATH}/packaging/windows_nsis.cmake) |
| 101 | +include(${CMAKE_MODULE_PATH}/packaging/windows_wix.cmake) |
0 commit comments