summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackNSISGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-14 19:29:15 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-14 19:29:15 (GMT)
commit21975ceda54ca51bcc4c86fe798d30f10297df82 (patch)
tree4fa32e6159c0166b45bd22ee780da45047349149 /Source/CPack/cmCPackNSISGenerator.cxx
parentc9ecd782374f814a760fdb98db7218b612d9f310 (diff)
downloadCMake-21975ceda54ca51bcc4c86fe798d30f10297df82.zip
CMake-21975ceda54ca51bcc4c86fe798d30f10297df82.tar.gz
CMake-21975ceda54ca51bcc4c86fe798d30f10297df82.tar.bz2
ENH: Better handling of executables on windows
Diffstat (limited to 'Source/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index fc69cf2..415129d 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -101,6 +101,34 @@ int cmCPackNSISGenerator::Initialize(const char* name, cmMakefile* mf)
return 0;
}
this->SetOption("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
+
+ const char* cpackPackageExecutables = this->GetOption("CPACK_PACKAGE_EXECUTABLES");
+ if ( cpackPackageExecutables )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl);
+ cmOStringStream str;
+ cmOStringStream deleteStr;
+ std::vector<std::string> cpackPackageExecutablesVector;
+ cmSystemTools::ExpandListArgument(cpackPackageExecutables,cpackPackageExecutablesVector);
+ if ( cpackPackageExecutablesVector.size() % 2 != 0 )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and <icon name>." << std::endl);
+ return 0;
+ }
+ std::vector<std::string>::iterator it;
+ for ( it = cpackPackageExecutablesVector.begin(); it != cpackPackageExecutablesVector.end();
+ ++it )
+ {
+ std::string execName = *it;
+ ++ it;
+ std::string linkName = *it;
+ str << " CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\" << linkName << ".lnk\"" "\"$INSTDIR\\bin\\" << execName << ".exe\"" << std::endl;
+ deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName << ".lnk\"" << std::endl;
+ }
+ this->SetOption("CPACK_NSIS_CREATE_ICONS", str.str().c_str());
+ this->SetOption("CPACK_NSIS_DELETE_ICONS", deleteStr.str().c_str());
+ }
+
return res;
}