diff options
author | Brad King <brad.king@kitware.com> | 2012-11-27 18:34:13 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-11-27 18:34:13 (GMT) |
commit | f30393e28a49fe4d4e29d41cfc6b2a663ea691c0 (patch) | |
tree | 019f63878f163e433df1fcf502cd5c58e4746c39 /Source | |
parent | 805c0f3f899413efe466eee06f46a1b4a3cb285a (diff) | |
parent | 6ff730a4983d15f3e115a919eb18d866f8c65507 (diff) | |
download | CMake-f30393e28a49fe4d4e29d41cfc6b2a663ea691c0.zip CMake-f30393e28a49fe4d4e29d41cfc6b2a663ea691c0.tar.gz CMake-f30393e28a49fe4d4e29d41cfc6b2a663ea691c0.tar.bz2 |
Merge topic 'cpack-nsis64-patches'
6ff730a CPack/NSIS: Add support for 64-bit NSIS (#13203)
51da766 CPack/NSIS: Fix compatibility issues with prerelease NSIS (#13202)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackGeneratorFactory.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.h | 7 |
3 files changed, 25 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 37ff460..eba1ef9 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -61,6 +61,8 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() { this->RegisterGenerator("NSIS", "Null Soft Installer", cmCPackNSISGenerator::CreateGenerator); + this->RegisterGenerator("NSIS64", "Null Soft Installer (64-bit)", + cmCPackNSISGenerator::CreateGenerator64); } #ifdef __CYGWIN__ if (cmCPackCygwinBinaryGenerator::CanGenerate()) diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index fdbae35..9f86ea2 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -33,8 +33,9 @@ #endif //---------------------------------------------------------------------- -cmCPackNSISGenerator::cmCPackNSISGenerator() +cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64) { + Nsis64 = nsis64; } //---------------------------------------------------------------------- @@ -359,6 +360,21 @@ int cmCPackNSISGenerator::InitializeInternal() bool gotRegValue = false; #ifdef _WIN32 + if (Nsis64) + { + if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, + cmsys::SystemTools::KeyWOW64_64) ) + { + gotRegValue = true; + } + if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, + cmsys::SystemTools::KeyWOW64_64) ) + { + gotRegValue = true; + } + } if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, cmsys::SystemTools::KeyWOW64_32) ) diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index 8224854..e46fbda 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -27,10 +27,13 @@ class cmCPackNSISGenerator : public cmCPackGenerator public: cmCPackTypeMacro(cmCPackNSISGenerator, cmCPackGenerator); + static cmCPackGenerator* CreateGenerator64() + { return new cmCPackNSISGenerator(true); } + /** * Construct generator */ - cmCPackNSISGenerator(); + cmCPackNSISGenerator(bool nsis64 = false); virtual ~cmCPackNSISGenerator(); protected: @@ -77,6 +80,8 @@ protected: /// Translations any newlines found in the string into \\r\\n, so that the /// resulting string can be used within NSIS. static std::string TranslateNewlines(std::string str); + + bool Nsis64; }; #endif |