summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-11 20:48:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-01-11 20:48:18 (GMT)
commit7ebfa8218b58d0b835fa23a6e40afe8043a17d7e (patch)
tree0737839207e8d0b4cafbb5f9c7b0dfc56ac322cc /Source
parentcaa45a5f817f3608c8f2b30b039925f4bafc0ea1 (diff)
parentbee514c3611f7a7b972d9ade14f94c0f25bc001e (diff)
downloadCMake-7ebfa8218b58d0b835fa23a6e40afe8043a17d7e.zip
CMake-7ebfa8218b58d0b835fa23a6e40afe8043a17d7e.tar.gz
CMake-7ebfa8218b58d0b835fa23a6e40afe8043a17d7e.tar.bz2
Merge topic 'cpack-nsis-changes'
bee514c Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144) 702c8f8 Add CPACK_NSIS_EXECUTABLES_DIRECTORY (#7828) fec3232 Allow NSIS package or uninstall icon (#11143)
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx41
1 files changed, 32 insertions, 9 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index f25866c..97885d5 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -129,14 +129,21 @@ int cmCPackNSISGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName
<< " to " << nsisFileName << std::endl);
if(this->IsSet("CPACK_NSIS_MUI_ICON")
- && this->IsSet("CPACK_NSIS_MUI_UNIICON"))
+ || this->IsSet("CPACK_NSIS_MUI_UNIICON"))
{
- std::string installerIconCode="!define MUI_ICON \"";
- installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
- installerIconCode += "\"\n";
- installerIconCode += "!define MUI_UNICON \"";
- installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
- installerIconCode += "\"\n";
+ std::string installerIconCode;
+ if(this->IsSet("CPACK_NSIS_MUI_ICON"))
+ {
+ installerIconCode += "!define MUI_ICON \"";
+ installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
+ installerIconCode += "\"\n";
+ }
+ if(this->IsSet("CPACK_NSIS_MUI_UNIICON"))
+ {
+ installerIconCode += "!define MUI_UNICON \"";
+ installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
+ installerIconCode += "\"\n";
+ }
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
installerIconCode.c_str());
}
@@ -149,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())
{
@@ -414,10 +432,13 @@ int cmCPackNSISGenerator::InitializeInternal()
return 0;
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
+ this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
const char* cpackPackageExecutables
= this->GetOption("CPACK_PACKAGE_EXECUTABLES");
const char* cpackPackageDeskTopLinks
= this->GetOption("CPACK_CREATE_DESKTOP_LINKS");
+ const char* cpackNsisExecutablesDirectory
+ = this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
std::vector<std::string> cpackPackageDesktopLinksVector;
if(cpackPackageDeskTopLinks)
{
@@ -465,7 +486,8 @@ int cmCPackNSISGenerator::InitializeInternal()
++ it;
std::string linkName = *it;
str << " CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\"
- << linkName << ".lnk\" \"$INSTDIR\\bin\\" << execName << ".exe\""
+ << linkName << ".lnk\" \"$INSTDIR\\"
+ << cpackNsisExecutablesDirectory << "\\" << execName << ".exe\""
<< std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName
<< ".lnk\"" << std::endl;
@@ -479,7 +501,8 @@ int cmCPackNSISGenerator::InitializeInternal()
{
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\"
- << linkName << ".lnk\" \"$INSTDIR\\bin\\" << execName << ".exe\""
+ << linkName << ".lnk\" \"$INSTDIR\\"
+ << cpackNsisExecutablesDirectory << "\\" << execName << ".exe\""
<< std::endl;
deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
deleteStr << " Delete \"$DESKTOP\\" << linkName