MantisBT - CMake
View Issue Details
0014211CMakeCPackpublic2013-06-10 05:422015-07-08 08:57
hsor001 
Brad King 
normalminoralways
closedfixed 
WindowsNTWindows 764 bit
CMake 2.8.11.1 
CMake 3.2CMake 3.2 
0014211: Default value for CPACK_NSIS_INSTALL_ROOT when installing 64 bit binaries is $PROGRAMFILES
When using the NSIS installer on Windows the default install root directory is set to $PROGRAMFILES. This is true even when installing 64 bit binaries on a 64 bit system.
Create 64 bit binary and create an NSIS installer. The default root install directory is (most likely) C:\Program Files (x86)\
I have attached a patch file that sets the default install root directory to $PROGRAMFILES64 when using the 64 bit cl compiler.
No tags attached.
patch update.patch (767) 2013-06-10 05:42
https://public.kitware.com/Bug/file/4784/update.patch
patch win64.patch (788) 2015-02-04 14:58
https://public.kitware.com/Bug/file/5373/win64.patch
patch v1-0001-CPack-Fix-NSIS-default-64-bit-Windows-install-direct.patch (1,979) 2015-02-04 15:12
https://public.kitware.com/Bug/file/5374/v1-0001-CPack-Fix-NSIS-default-64-bit-Windows-install-direct.patch
Issue History
2013-06-10 05:42hsor001New Issue
2013-06-10 05:42hsor001File Added: update.patch
2015-02-01 06:05İsmail DönmezNote Added: 0037872
2015-02-03 11:48Brad KingNote Added: 0037889
2015-02-03 11:53Brad KingNote Added: 0037890
2015-02-04 13:55İsmail DönmezNote Added: 0037906
2015-02-04 14:02Brad KingNote Added: 0037907
2015-02-04 14:05İsmail DönmezNote Added: 0037908
2015-02-04 14:30Brad KingNote Added: 0037909
2015-02-04 14:58İsmail DönmezFile Added: win64.patch
2015-02-04 14:58İsmail DönmezNote Added: 0037910
2015-02-04 15:12Brad KingFile Added: v1-0001-CPack-Fix-NSIS-default-64-bit-Windows-install-direct.patch
2015-02-04 15:13Brad KingNote Added: 0037911
2015-02-04 15:30İsmail DönmezNote Added: 0037913
2015-02-04 15:32Brad KingNote Added: 0037914
2015-02-04 15:32Brad KingAssigned To => Brad King
2015-02-04 15:32Brad KingStatusnew => assigned
2015-02-04 15:32Brad KingTarget Version => CMake 3.2
2015-02-04 16:46Brad KingNote Added: 0037917
2015-02-04 16:46Brad KingStatusassigned => resolved
2015-02-04 16:46Brad KingResolutionopen => fixed
2015-02-04 16:46Brad KingFixed in Version => CMake 3.2
2015-07-08 08:57Robert MaynardNote Added: 0039038
2015-07-08 08:57Robert MaynardStatusresolved => closed

Notes
(0037872)
İsmail Dönmez   
2015-02-01 06:05   
This patch still makes sense for cmake 3.x, can someone please review it?
(0037889)
Brad King   
2015-02-03 11:48   
Re 0014211:0037872: One should check that CMAKE_SIZEOF_VOID_P:

 http://www.cmake.org/cmake/help/v3.1/variable/CMAKE_SIZEOF_VOID_P.html [^]

is equal to 8 to recognize 64-bit target architectures.
(0037890)
Brad King   
2015-02-03 11:53   
Re 0014211:0037889: Furthermore, the selection of the environment variable may depend on whether CMake itself is a 64-bit or 32-bit binary. See the selection of CMAKE_INSTALL_PREFIX default here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeGenericSystem.cmake;hb=v3.1.1#l70 [^]

Perhaps something should be refactored such that this logic can be re-used for CPACK_NSIS_INSTALL_ROOT.
(0037906)
İsmail Dönmez   
2015-02-04 13:55   
Shouldn't the CMAKE_SIZEOF_VOID_P solution be enough? Since if the compiler does create 64bit binaries then we want the 64bit programs directory.
(0037907)
Brad King   
2015-02-04 14:02   
Re 0014211:0037906: CMAKE_SIZEOF_VOID_P is enough to know whether we want the 64-bit programs directory, but my comment in 0014211:0037890 is saying that it is tricky to know where the 64-bit programs directory is located. The needed environment variable depends on how CMake itself was built.
(0037908)
İsmail Dönmez   
2015-02-04 14:05   
$PROGRAMFILES64 is an NSIS only variable, we don't even need CMake there.
(0037909)
Brad King   
2015-02-04 14:30   
Re 0014211:0037908: Right, sorry. Yes, I think a patch with CMAKE_SIZEOF_VOID_P should be sufficient since NSIS will take care of finding the right 64-bit programs directory on the end user system.
(0037910)
İsmail Dönmez   
2015-02-04 14:58   
win64.patch is the updated version of the original patch using CMAKE_SIZEOF_VOID_P.
(0037911)
Brad King   
2015-02-04 15:13   
Re 0014211:0037910: It turns out that code just above the hunk you modified changes the system name to either "win32" or "win64". Please try

  v1-0001-CPack-Fix-NSIS-default-64-bit-Windows-install-direct.patch
(0037913)
İsmail Dönmez   
2015-02-04 15:30   
Looks good upon inspection but can't test unless you upload a build I am afraid.
(0037914)
Brad King   
2015-02-04 15:32   
Re 0014211:0037913: You should be able to apply the patch manually to your installation's CPack module. Otherwise you can wait for a nightly build to show up here:

 http://www.cmake.org/files/dev/?C=M;O=D [^]

containing the change:

 CPack: Fix NSIS default 64-bit Windows install directory
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecaee7ca [^]
(0037917)
Brad King   
2015-02-04 16:46   
Re 0014211:0037914: Marking as resolved with that commit. Please report back results from testing in case we need to re-open.
(0039038)
Robert Maynard   
2015-07-08 08:57   
Closing resolved issues that have not been updated in more than 4 months.