diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ef744909..e01fb0014 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,22 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) if(WIN32) - set(CPACK_GENERATOR ZIP) # just use zip? CPack has some GUI install as well + set(CPACK_STRIP_FILES "VCMI_launcher.exe;VCMI_client.exe;VCMI_server.exe;VCMI_lib.exe;AI/BattleAI.dll;AI/EmptyAI.dll;AI/StupidAI.dll;AI/VCAI.dll") + + set(CPACK_MONOLITHIC_INSTALL 1) + set(CPACK_PACKAGE_NAME "VCMI") + set(CPACK_PACKAGE_VENDOR "VCMI team") + set(CPACK_PACKAGE_FILE_NAME "vcmi-${CPACK_PACKAGE_VERSION}-win32") + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") + set(CPACK_PACKAGE_EXECUTABLES "VCMI_launcher;VCMI") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") + set(CPACK_NSIS_PACKAGE_NAME "VCMI ${CPACK_PACKAGE_VERSION}") + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") + set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " CreateShortCut \\\"$DESKTOP\\\\VCMI.lnk\\\" \\\"$INSTDIR\\\\VCMI_launcher.exe\\\"") + set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS " Delete \\\"$DESKTOP\\\\VCMI.lnk\\\" ") + + configure_file("${CMAKE_SOURCE_DIR}/cmake_modules/CMakeCPackOptions.cmake.in" "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) + set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake") elseif(APPLE) set(CPACK_GENERATOR DragNDrop) set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/osx/dmg_background.png") diff --git a/cmake_modules/CMakeCPackOptions.cmake.in b/cmake_modules/CMakeCPackOptions.cmake.in new file mode 100644 index 000000000..b39bc5030 --- /dev/null +++ b/cmake_modules/CMakeCPackOptions.cmake.in @@ -0,0 +1,26 @@ +# This file is configured at cmake time, and loaded at cpack time. +# To pass variables to cpack from cmake, they must be configured +# in this file. + +if(CPACK_GENERATOR MATCHES "NSIS") + set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@") + + # set the install/unistall icon used for the installer itself + # There is a bug in NSI that does not handle full unix paths properly. + set(CPACK_NSIS_MUI_ICON "@CMAKE_SOURCE_DIR@/client\\vcmi.ico") + set(CPACK_NSIS_MUI_UNIICON "@CMAKE_SOURCE_DIR@/client\\vcmi.ico") + # set the package header icon for MUI + set(CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR@/client\\vcmi.ico") + + set(CPACK_NSIS_MENU_LINKS + "http://vcmi.eu/" "VCMI Web Site") + + set(CPACK_NSIS_INSTALLED_ICON_NAME "VCMI_client.exe") + set(CPACK_NSIS_COMPRESSOR "/SOLID lzma") + set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@") + set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, open-source engine for Heroes of Might and Magic III ") + set(CPACK_NSIS_HELP_LINK "http://vcmi.eu/") + set(CPACK_NSIS_URL_INFO_ABOUT "http://vcmi.eu/") + set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) + set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") +endif() \ No newline at end of file