Allow NSIS package or uninstall icon (#11143)

Previously both CPACK_NSIS_MUI_ICON and CPACK_NSIS_MUI_UNIICON
needed to be set for either to take effect. This commit allows
either to be set rather than requiring both as users may well
want to e.g. use a default uninstall icon but a custom install
icon.
This commit is contained in:
Mike McQuaid 2011-01-06 12:35:48 +00:00 committed by David Cole
parent 8e6ad8ce72
commit fec32328b1
1 changed files with 14 additions and 7 deletions

View File

@ -129,14 +129,21 @@ int cmCPackNSISGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName
<< " to " << nsisFileName << std::endl); << " to " << nsisFileName << std::endl);
if(this->IsSet("CPACK_NSIS_MUI_ICON") 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 \""; std::string installerIconCode;
if(this->IsSet("CPACK_NSIS_MUI_ICON"))
{
installerIconCode += "!define MUI_ICON \"";
installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON"); installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
installerIconCode += "\"\n"; installerIconCode += "\"\n";
}
if(this->IsSet("CPACK_NSIS_MUI_UNIICON"))
{
installerIconCode += "!define MUI_UNICON \""; installerIconCode += "!define MUI_UNICON \"";
installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON"); installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
installerIconCode += "\"\n"; installerIconCode += "\"\n";
}
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE", this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
installerIconCode.c_str()); installerIconCode.c_str());
} }