Skip to content

Commit fee5274

Browse files
authored
Merge pull request #749 from openstudiocoalition/improve_installer
Improve installer
2 parents c658cda + 53e271e commit fee5274

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

CMakeLists.txt

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,14 +813,20 @@ endif()
813813
# Leaving it
814814
set(CPACK_IFW_VERBOSE ON)
815815

816-
set(CPACK_PACKAGE_VENDOR "OpenStudio Coalition")
816+
set(CPACK_PACKAGE_VENDOR "OpenStudio Coalition") # CPACK_IFW_PACKAGE_PUBLISHER is set from this
817+
817818
# These are ok, even if we have a prerelease tag
818819
set(CPACK_PACKAGE_VERSION_MAJOR ${OpenStudioApplication_VERSION_MAJOR})
819820
set(CPACK_PACKAGE_VERSION_MINOR ${OpenStudioApplication_VERSION_MINOR})
820821
set(CPACK_PACKAGE_VERSION_PATCH ${OpenStudioApplication_VERSION_PATCH})
821822

822823
# CPACK_DEBIAN_PACKAGE_DESCRIPTION defaults to this one too. dpkg-deb -I xxx.deb will show this description
823-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenStudioApplication ${OpenStudioApplication_VERSION}, based on openstudio (core) ${OPENSTUDIO_VERSION}. OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance")
824+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenStudioApplication ${OpenStudioApplication_VERSION} is a Graphical User Interface for OpenStudio")
825+
set(CPACK_PACKAGE_DESCRIPTION "OpenStudioApplication ${OpenStudioApplication_VERSION}, based on openstudio (core) ${OPENSTUDIO_VERSION}. OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance")
826+
827+
set(CPACK_IFW_PACKAGE_TITLE "OpenStudioApplication ${OpenStudioApplication_VERSION}")
828+
set(CPACK_IFW_PRODUCT_URL "https://openstudiocoalition.org")
829+
set(CPACK_IFW_PACKAGE_WINDOW_ICON "${PROJECT_SOURCE_DIR}/icons/os_32.png")
824830

825831
# The actual package file name on disk
826832
if(APPLE)
@@ -836,13 +842,21 @@ endif()
836842

837843
set(CPACK_PACKAGE_CONTACT "osc@openstudiocoalition.org")
838844

839-
# Install additional Documents, such as release notes
840-
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_GPL_3_0.txt" DESTINATION .)
841-
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_LGPL_3_0.txt" DESTINATION .)
842-
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION .)
845+
# Install additional Documents, such as release notes
846+
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_GPL_3_0.txt" DESTINATION . COMPONENT Licenses)
847+
install(FILES "${PROJECT_SOURCE_DIR}/QT_LICENSE_LGPL_3_0.txt" DESTINATION . COMPONENT Licenses)
848+
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION . COMPONENT Licenses)
849+
850+
# Not sure whether we want a "Accept license" box in the IFW installer or not...
851+
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.md")
852+
# set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/release/readme.html")
843853

844854
if (APPLE)
845855
set(CPACK_IFW_TARGET_DIRECTORY /Applications/OpenStudioApplication-${OpenStudioApplication_VERSION}/)
856+
# Custom installer icon. Has to be .icns on mac, .ico on windows, not supported on Unix
857+
set(CPACK_IFW_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icons/os.icns")
858+
# Launch OpenStudioApp at end of install
859+
set(CPACK_IFW_PACKAGE_RUN_PROGRAM "@TargetDir@/OpenStudioApp.app/Contents/MacOS/OpenStudioApp")
846860
elseif(UNIX)
847861

848862
# For debug
@@ -932,6 +946,12 @@ elseif(WIN32)
932946
set(CPACK_IFW_TARGET_DIRECTORY "C:/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
933947
set(CPACK_BINARY_IFW ON CACHE BOOL "Enable to build IFW packages")
934948
set(CPACK_BINARY_NSIS OFF CACHE BOOL "Enable to build NSIS packages")
949+
950+
# Custom installer icon. Has to be .icns on mac, .ico on windows, not supported on Unix
951+
set(CPACK_IFW_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icons/os.ico")
952+
953+
# Launch OpenStudioApp at end of install
954+
set(CPACK_IFW_PACKAGE_RUN_PROGRAM "@TargetDir@/bin/OpenStudioApp")
935955
endif()
936956

937957

@@ -988,6 +1008,7 @@ cpack_add_component(Resources
9881008
cpack_add_component(OpenStudioApp
9891009
DISPLAY_NAME "OpenStudio Application"
9901010
DESCRIPTION "OpenStudio Application"
1011+
REQUIRED
9911012
)
9921013

9931014
cpack_ifw_configure_component(Resources
@@ -1017,6 +1038,19 @@ cpack_add_component(RubyAPI
10171038
DESCRIPTION "The Ruby openstudio modeleditor for Sketchup"
10181039
)
10191040

1041+
cpack_add_component(
1042+
Licenses
1043+
DISPLAY_NAME "Licenses"
1044+
DESCRIPTION "License files for OpenStudio Application"
1045+
REQUIRED
1046+
HIDDEN
1047+
)
1048+
1049+
cpack_ifw_configure_component(Licenses
1050+
FORCED_INSTALLATION
1051+
LICENSES "OpenStudio Application" ${CPACK_RESOURCE_FILE_LICENSE}
1052+
)
1053+
10201054
add_custom_target(PACKAGE_DEBUG
10211055
COMMAND ${CMAKE_CPACK_COMMAND} --debug --verbose --config CPackConfig.cmake
10221056
COMMENTS "Build package with debug and verbose output"

0 commit comments

Comments
 (0)