From ef81ac50e5d6e981088c00e822fde538d9da9e37 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 18 Jun 2007 09:00:33 -0400 Subject: [PATCH] =?UTF-8?q?ENH:=20NSIS=20exists=20also=20for=20Linux,=20no?= =?UTF-8?q?t=20only=20Windows,=20so=20enable=20it=20there=20too=20patch=20?= =?UTF-8?q?by=20=20=20Michal=20=C4=8Ciha=C5=99=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alex --- Source/CPack/cmCPackGenerators.cxx | 6 +----- Source/CPack/cmCPackNSISGenerator.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/CPack/cmCPackGenerators.cxx b/Source/CPack/cmCPackGenerators.cxx index e94fb337a..629156a3f 100644 --- a/Source/CPack/cmCPackGenerators.cxx +++ b/Source/CPack/cmCPackGenerators.cxx @@ -23,9 +23,7 @@ #include "cmCPackTarCompressGenerator.h" #include "cmCPackZIPGenerator.h" #include "cmCPackSTGZGenerator.h" -#ifdef _WIN32 -# include "cmCPackNSISGenerator.h" -#endif +#include "cmCPackNSISGenerator.h" #ifdef __APPLE__ # include "cmCPackPackageMakerGenerator.h" # include "cmCPackOSXX11Generator.h" @@ -45,10 +43,8 @@ cmCPackGenerators::cmCPackGenerators() cmCPackTGZGenerator::CreateGenerator); this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression", cmCPackSTGZGenerator::CreateGenerator); -#ifdef _WIN32 this->RegisterGenerator("NSIS", "Null Soft Installer", cmCPackNSISGenerator::CreateGenerator); -#endif #ifdef __CYGWIN__ this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer", cmCPackCygwinBinaryGenerator::CreateGenerator); diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index f973acc6b..dc1b852dc 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -29,6 +29,13 @@ #include #include +/* NSIS uses different command line syntax on Windows and others */ +#ifdef _WIN32 +# define NSIS_OPT "/" +#else +# define NSIS_OPT "-" +#endif + //---------------------------------------------------------------------- cmCPackNSISGenerator::cmCPackNSISGenerator() { @@ -144,6 +151,8 @@ int cmCPackNSISGenerator::InitializeInternal() << std::endl); std::vector path; std::string nsisPath; + +#ifdef _WIN32 if ( !cmsys::SystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) ) { @@ -156,6 +165,7 @@ int cmCPackNSISGenerator::InitializeInternal() return 0; } path.push_back(nsisPath); +#endif nsisPath = cmSystemTools::FindProgram("makensis", path, false); if ( nsisPath.empty() ) { @@ -163,7 +173,7 @@ int cmCPackNSISGenerator::InitializeInternal() << std::endl); return 0; } - std::string nsisCmd = "\"" + nsisPath + "\" /VERSION"; + std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION"; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: " << nsisCmd.c_str() << std::endl); std::string output;