MantisBT - CMake
View Issue Details
0009148CMakeCPackpublic2009-06-12 18:552011-05-02 14:45
Cory W Quammen 
David Cole 
lowtweakalways
closedfixed 
CMake-2-6 
CMake 2.8.4CMake 2.8.4 
0009148: Cannot change default program installation directory with NSIS generator
The NSIS.template.in file provides no way to change the default root program installation directory. This line shows why:

InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"

$PROGRAMFILES is taken from the environment variable ProgramFiles in Windows and typically evaluates to C:\Program Files on most systems.

It would be nice to change $PROGRAMFILES to another CPack variable, something like CPACK_PACKAGE_INSTALL_DIRECTORY_ROOT. The default value of this variable should be $PROGRAMFILES to preserve the current behavior.

Lines 28 and 900 in revision 1.36 of /Modules/NSIS.template.in are relevant to this request.
No tags attached.
related to 0009094closed Kitware Robot NSIS needs to detect 32-bit/64-bit packaging projects 
Issue History
2009-06-12 18:55Cory W QuammenNew Issue
2009-09-14 14:50Bill HoffmanStatusnew => assigned
2009-09-14 14:50Bill HoffmanAssigned To => David Cole
2009-12-16 19:24David ColeNote Added: 0018937
2009-12-16 19:25David ColePrioritynormal => low
2010-12-17 07:41David ColeTarget Version => CMake 2.8.4
2011-01-10 09:40David ColeRelationship addedrelated to 0009094
2011-01-10 10:10David ColeNote Added: 0024531
2011-01-10 10:10David ColeStatusassigned => resolved
2011-01-10 10:10David ColeFixed in Version => CMake 2.8.4
2011-01-10 10:10David ColeResolutionopen => fixed
2011-05-02 14:45David ColeNote Added: 0026327
2011-05-02 14:45David ColeStatusresolved => closed

Notes
(0018937)
David Cole   
2009-12-16 19:24   
The title of this issue is worded a little too strongly:
"*Cannot* change default program installation directory with NSIS generator"

There is a way you can do it, at least as a workaround until this issue is addressed...

Make your own copy of the NSIS.template.in file
Put it in a directory named "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
Make edits to your own NSIS.template.in file as needed
Put this in your CMakeLists.txt file:
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})

Voila.

CPack will now use your NSIS.template.in file instead of the built-in one.
(0024531)
David Cole   
2011-01-10 10:10   
Fixed by this commit, just pushed to 'next':
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c3b0c1f4c2d00cc3adf036c5ff05917cea84cd7 [^]

Should make it into 2.8.4...
(0026327)
David Cole   
2011-05-02 14:45   
Closing resolved issues that have not been updated in more than 3 months.