diff options
author | Mike McQuaid <mike@mikemcquaid.com> | 2011-01-06 13:44:50 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-01-06 21:21:36 (GMT) |
commit | bee514c3611f7a7b972d9ade14f94c0f25bc001e (patch) | |
tree | f388ae1be605509a3dfc5f764a3d833556e4f469 | |
parent | 702c8f8ba79591744449244ed47a5181fdf68a63 (diff) | |
download | CMake-bee514c3611f7a7b972d9ade14f94c0f25bc001e.zip CMake-bee514c3611f7a7b972d9ade14f94c0f25bc001e.tar.gz CMake-bee514c3611f7a7b972d9ade14f94c0f25bc001e.tar.bz2 |
Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144)
MUI_FINISHPAGE_RUN is frequently used with NSIS and provides a checkbox
on the finish page of an installer which specifies whether the specified
executable should be run when the installer exits. This commit adds support
for this setting in CPack.
-rw-r--r-- | Modules/CPack.cmake | 3 | ||||
-rw-r--r-- | Modules/NSIS.template.in | 1 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 11 |
3 files changed, 15 insertions, 0 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index dc65b5a..5f9f05f 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -262,6 +262,9 @@ # For example, you would set this to 'exec' if your executables are # in an exec directory. # +# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option +# to run on the finish page of the NSIS installer. +# # The following variable is specific to installers build on Mac OS X # using PackageMaker: # diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 776bc07..ffe0515 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -540,6 +540,7 @@ FunctionEnd @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ +@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ ;-------------------------------- ;Pages diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index d27ab0a..97885d5 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -156,6 +156,17 @@ int cmCPackNSISGenerator::PackageFiles() installerIconCode.c_str()); } + if(this->IsSet("CPACK_NSIS_MUI_FINISHPAGE_RUN")) + { + std::string installerRunCode = "!define MUI_FINISHPAGE_RUN \"$INSTDIR\\"; + installerRunCode += this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY"); + installerRunCode += "\\"; + installerRunCode += this->GetOption("CPACK_NSIS_MUI_FINISHPAGE_RUN"); + installerRunCode += "\"\n"; + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE", + installerRunCode.c_str()); + } + // Setup all of the component sections if (this->Components.empty()) { |