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.
This commit is contained in:
parent
702c8f8ba7
commit
bee514c361
Modules
Source/CPack
|
@ -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:
|
||||
#
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue