MantisBT - CMake
View Issue Details
0013085CMakeCPackpublic2012-03-31 13:242013-01-09 10:55
David Golub 
David Cole 
normalminorN/A
closedfixed 
CMake 2.8.7 
CMake 2.8.9CMake 2.8.9 
0013085: Unable to run custom NSIS commands before installation
CPack provides the ability to run custom NSIS commands at the end of the setup process by setting the variable CPACK_NSIS_EXTRA_INSTALL_COMMANDS. However, there is no way to specify custom commands to run at the beginning of the setup process before files are copied. I'd like to submit a patch to address this issue.

diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -29,8 +29,13 @@
 ##end
 #
 ##variable
+# CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS - Extra NSIS commands that will
+# be added to the beginning of the install Section.
+##end
+#
+##variable
 # CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
-# be added to the install Section.
+# be added to the end of the install Section.
 ##end
 #
 ##variable
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -637,6 +637,7 @@
   ;Use the entire tree produced by the INSTALL target. Keep the
   ;list of directories here in sync with the RMDir commands below.
   SetOutPath "$INSTDIR"
+ @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
   @CPACK_NSIS_FULL_INSTALL@
   
   ;Store installation folder
No tags attached.
Issue History
2012-03-31 13:24David GolubNew Issue
2012-04-21 11:21David ColeAssigned To => David Cole
2012-04-21 11:21David ColeStatusnew => assigned
2012-04-21 11:22David ColeDescription Updatedbug_revision_view_page.php?rev_id=619#r619
2012-04-22 12:06David ColeTarget Version => CMake 2.8.9
2012-04-22 12:07David ColeNote Added: 0029298
2012-04-22 12:07David ColeStatusassigned => resolved
2012-04-22 12:07David ColeResolutionopen => fixed
2012-08-09 16:55David ColeFixed in Version => CMake 2.8.9
2013-01-09 10:55Robert MaynardNote Added: 0032015
2013-01-09 10:55Robert MaynardStatusresolved => closed

Notes
(0029298)
David Cole   
2012-04-22 12:07   
Fix merged to the CMake 'next' branch yesterday:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa8acea3982582cb8e20f69ec897aed6dd31a0a5 [^]
(0032015)
Robert Maynard   
2013-01-09 10:55   
Closing resolved issues that have not been updated in more than 4 months.