diff --git a/scripts/CPackRuntimeSettings.cmake b/scripts/CPackRuntimeSettings.cmake deleted file mode 100644 index 95683831c4..0000000000 --- a/scripts/CPackRuntimeSettings.cmake +++ /dev/null @@ -1,62 +0,0 @@ - - ############################### -# # -# CCC PPPP A CCC K K # -# C C P P A A C C K K # -# C PPPP AAAAA C KKK # -# C C P A A C C K K # -# CCC P A A CCC K K # -# # -# SSSS U U CCC K K SSSS # -# S U U C C K K S # -# SSS U U C KKK SSS # -# S U U C C K K S # -# SSSS UUU CCC K K SSSS # -# # - ############################### - -set(CLEANUP_COMMANDS " - DeleteRegKey HKCR \".tsr\" - DeleteRegKey HKCR \"TaiseiProject.tsr\" - DeleteRegKey HKCR \"TaiseiProject.tsr\\DefaultIcon\" - DeleteRegKey HKCR \"TaiseiProject.tsr\\Shell\" - DeleteRegKey HKCR \"TaiseiProject.tsr\\Shell\\Open\" - DeleteRegKey HKCR \"TaiseiProject.tsr\\Shell\\Open\\Command\" - DeleteRegKey HKCR \"Applications\\taisei.exe\" - DeleteRegKey HKCR \"Applications\\taisei.exe\\DefaultIcon\" - DeleteRegKey HKCR \"Applications\\taisei.exe\\Shell\" - DeleteRegKey HKCR \"Applications\\taisei.exe\\Shell\\Open\" - DeleteRegKey HKCR \"Applications\\taisei.exe\\Shell\\Open\\Command\" -") - -set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " - ${CLEANUP_COMMANDS} - WriteRegStr HKCR \".tsr\" \"\" \"TaiseiProject.tsr\" - WriteRegStr HKCR \".tsr\" \"Content Type\" \"application/x-taisei-replay\" - WriteRegStr HKCR \"TaiseiProject.tsr\" \"\" \"Taisei Project replay\" - WriteRegStr HKCR \"TaiseiProject.tsr\" \"FriendlyTypeName\" \"@$INSTDIR\\taisei.exe,-2\" - WriteRegStr HKCR \"TaiseiProject.tsr\\DefaultIcon\" \"\" \"$INSTDIR\\taisei.exe,1\" - WriteRegStr HKCR \"TaiseiProject.tsr\\Shell\\Open\\Command\" \"\" \"$\\\"$INSTDIR\\taisei.exe$\\\" --replay $\\\"%1$\\\"\" - WriteRegStr HKCR \"Applications\\taisei.exe\" \"\" \"Taisei Project\" - WriteRegStr HKCR \"Applications\\taisei.exe\" \"FriendlyAppName\" \"@$INSTDIR\\taisei.exe,-1\" - WriteRegStr HKCR \"Applications\\taisei.exe\\DefaultIcon\" \"\" \"$INSTDIR\\taisei.exe,1\" - WriteRegStr HKCR \"Applications\\taisei.exe\\Shell\\Open\\Command\" \"\" \"$\\\"$INSTDIR\\taisei.exe$\\\" --replay $\\\"%1$\\\"\" -") - -set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CLEANUP_COMMANDS}") - - ############################### -# # -# CCC M M A K K EEEEE # -# C C MM MM A A K K E # -# C M M M AAAAA KKK EEEE # -# C C M M A A K K E # -# CCC M M A A K K EEEEE # -# # -# SSSS U U CCC K K SSSS # -# S U U C C K K S # -# SSS U U C KKK SSS # -# S U U C C K K S # -# SSSS UUU CCC K K SSSS # -# # - ############################### diff --git a/scripts/CPackRuntimeSettings.cmake.in b/scripts/CPackRuntimeSettings.cmake.in new file mode 100644 index 0000000000..f8908bf7b7 --- /dev/null +++ b/scripts/CPackRuntimeSettings.cmake.in @@ -0,0 +1,2 @@ + +set(CPACK_RESOURCE_FILE_LICENSE "@_CPACK_RESOURCE_FILE_LICENSE@") diff --git a/scripts/CPackSettings.cmake b/scripts/CPackSettings.cmake index ef86b26d7c..1d2b5086b7 100644 --- a/scripts/CPackSettings.cmake +++ b/scripts/CPackSettings.cmake @@ -9,10 +9,10 @@ endif() if(WIN32) set(CPACK_GENERATOR "${NSIS};7Z") - set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/win32docs/COPYING") + set(_CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/win32docs/COPYING") else() set(CPACK_GENERATOR "TGZ") - set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") + set(_CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") endif() set(CPACK_PACKAGE_NAME "Taisei") @@ -30,6 +30,14 @@ set(CPACK_PACKAGE_EXECUTABLES "taisei" "Taisei") set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") set(CPACK_NSIS_INSTALLED_ICON_NAME "taisei.exe") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "taisei.exe") -set(CPACK_NSIS_HELP_LINK "http://taisei-project.org") +set(CPACK_NSIS_HELP_LINK "https://taisei-project.org/") +set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL TRUE) + +configure_file( + "${BUILDSCRIPTS_DIR}/CPackRuntimeSettings.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/CPackRuntimeSettings.cmake" +@ONLY) + +set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/CPackRuntimeSettings.cmake") include(CPack)