View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013203CMakeCPackpublic2012-05-08 15:082013-04-17 08:54
ReporterDavid Golub 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityN/A
StatusclosedResolutionfixed 
PlatformIntel x64OSMicrosoft WindowsOS VersionWindows 7
Product VersionCMake 2.8.8 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013203: Add support for 64-bit NSIS
DescriptionI recently created a 64-bit port of NSIS, which is available at http://www.bitbucket.org/dgolub/nsis64. [^] I'd like to submit a patch to CPack to add support for building 64-bit installers:

diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -49,6 +49,8 @@
     cmCPackSTGZGenerator::CreateGenerator);
   this->RegisterGenerator("NSIS", "Null Soft Installer",
     cmCPackNSISGenerator::CreateGenerator);
+ this->RegisterGenerator("NSIS64", "Null Soft Installer (64-bit)",
+ cmCPackNSISGenerator::CreateGenerator64);
 #ifdef __CYGWIN__
   this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer",
                           cmCPackCygwinBinaryGenerator::CreateGenerator);
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -33,8 +33,9 @@
 #endif
 
 //----------------------------------------------------------------------
-cmCPackNSISGenerator::cmCPackNSISGenerator()
+cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64)
 {
+ Nsis64 = nsis64;
 }
 
 //----------------------------------------------------------------------
@@ -358,16 +359,28 @@
   bool gotRegValue = true;
 
 #ifdef _WIN32
- if ( !cmsys::SystemTools::ReadRegistryValue(
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
- cmsys::SystemTools::KeyWOW64_32) )
+ if (Nsis64)
     {
     if ( !cmsys::SystemTools::ReadRegistryValue(
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
+ cmsys::SystemTools::KeyWOW64_64) )
       {
       gotRegValue = false;
       }
     }
+ else
+ {
+ if ( !cmsys::SystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
+ cmsys::SystemTools::KeyWOW64_32) )
+ {
+ if ( !cmsys::SystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
+ {
+ gotRegValue = false;
+ }
+ }
+ }
 
   if (gotRegValue)
     {
diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h
--- a/Source/CPack/cmCPackNSISGenerator.h
+++ b/Source/CPack/cmCPackNSISGenerator.h
@@ -27,10 +27,13 @@
 public:
   cmCPackTypeMacro(cmCPackNSISGenerator, cmCPackGenerator);
 
+ static cmCPackGenerator* CreateGenerator64()
+ { return new cmCPackNSISGenerator(true); }
+
   /**
    * Construct generator
    */
- cmCPackNSISGenerator();
+ cmCPackNSISGenerator(bool nsis64 = false);
   virtual ~cmCPackNSISGenerator();
 
 protected:
@@ -75,6 +78,8 @@
   /// 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
Additional InformationPlease note that this patch is dependent on the patch submitted with bug 13202, as the 64-bit port of NSIS is based on the latest code from the NSIS Subversion repository.
TagsNo tags attached.
Attached Filespatch file icon 0001-CPack-NSIS-Fix-compatibility-issues-with-prerelease-.patch [^] (1,335 bytes) 2012-05-09 15:36 [Show Content]
patch file icon 0001-CPack-NSIS-Add-support-for-64-bit-NSIS-13203.patch [^] (3,485 bytes) 2012-05-09 15:37 [Show Content]

 Relationships
related to 0013202closedDavid Cole CPack fails with latest prerelease NSIS 

  Notes
(0029427)
David Cole (manager)
2012-05-08 17:02

Please create patches for CMake using git, based on the 'master' branch, and then:

  git format-patch -1

And then attach the resulting .patch file to this issue in the bug tracker.

Thanks.
(0029458)
David Golub (reporter)
2012-05-09 15:37

I've uploaded the patch file as you've requested.
(0031074)
David Cole (manager)
2012-09-20 17:18

I will try to get this in soon, in time for 2.8.10-rc1
(0031143)
David Cole (manager)
2012-10-01 15:20

The deadline has past for getting proposed changes into CMake 2.8.10-rc1: setting target version to 2.8.11
(0031634)
David Cole (manager)
2012-11-20 16:59

Fix pushed and merged to the 'next' branch:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ff730a4983d15f3e115a919eb18d866f8c65507 [^]

I had to rewrite the commit a little bit to adapt to code that has since been added to master regarding the UNICODE build of the NSIS installer builder. Take a look at this, and try it out in this form to make sure it still works for you with your 64-bit build of NSIS. (It will prefer a UNICODE install of NSIS over a non-UNICODE install, whether seeking the 32-bit or the 64-bit installer...)

Thanks for your contribution!
(0032874)
Robert Maynard (manager)
2013-04-17 08:54

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-05-08 15:08 David Golub New Issue
2012-05-08 16:48 Eric NOULARD Relationship added child of 0013202
2012-05-08 16:48 Eric NOULARD Relationship replaced related to 0013202
2012-05-08 17:02 David Cole Note Added: 0029427
2012-05-09 15:36 David Golub File Added: 0001-CPack-NSIS-Fix-compatibility-issues-with-prerelease-.patch
2012-05-09 15:37 David Golub Note Added: 0029458
2012-05-09 15:37 David Golub File Added: 0001-CPack-NSIS-Add-support-for-64-bit-NSIS-13203.patch
2012-06-20 18:34 David Cole Assigned To => David Cole
2012-06-20 18:34 David Cole Status new => assigned
2012-08-14 19:12 David Cole Target Version => CMake 2.8.10
2012-09-20 17:18 David Cole Note Added: 0031074
2012-10-01 15:20 David Cole Note Added: 0031143
2012-10-01 15:20 David Cole Target Version CMake 2.8.10 => CMake 2.8.11
2012-11-20 16:59 David Cole Note Added: 0031634
2012-11-20 16:59 David Cole Status assigned => resolved
2012-11-20 16:59 David Cole Fixed in Version => CMake 2.8.11
2012-11-20 16:59 David Cole Resolution open => fixed
2013-04-17 08:54 Robert Maynard Note Added: 0032874
2013-04-17 08:54 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team