View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014522CMakeCPackpublic2013-10-29 12:052016-06-10 14:31
ReporterMark Stijnman 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.12 
Target VersionFixed in Version 
Summary0014522: CPACK_NSIS_DEFINES doesn't work in component-based installer
DescriptionI need to add some options to my NSIS installer, and noticed in the NSIS.template.in there is a variable CPACK_NSIS_DEFINES that looked suitable. Even though it doesn't appear to be documented, I've found mentions online of users who have used this variable for similar purposes (for example http://www.cmake.org/pipermail/cmake/2009-April/028592.html [^] and http://public.kitware.com/Bug/view.php?id=5939 [^]), so apparently this used to work. However, it doesn't use for my project. When I tried to create a minimal example, it worked again. Turns out that the problem only shows up when you use a component-based installer. In that case, the contents of the CPACK_NSIS_DEFINES variable don't make it into the project.nsi file at all. If I check the source code in cmCPackNSISGenerator.cxx, I see that its value is overwritten in function PackageFiles when components are present.
Steps To ReproduceUse the following as a CMakeLists.txt file:
--- CMakeLists.txt begin

cmake_minimum_required(VERSION 2.8)

project(cpack_nsis_defines_test)
set(test_file "${CMAKE_CURRENT_BINARY_DIR}/test.txt")
file(WRITE ${test_file} "test")
install(FILES ${test_file} DESTINATION . COMPONENT test)
set(CPACK_COMPONENTS_ALL test)
set(CPACK_NSIS_DEFINES " !define MUI_WELCOMEPAGE_TITLE_3LINES")
include(CPack)

--- CMakeLists.txt end

If you build the PACKAGE target, and run the installer, you will notice that the MUI_WELCOMEPAGE_TITLE_3LINES didn't have any effect. If you check the project.nsi file that is generated, you see that the MUI_WELCOMEPAGE_TITLE_3LINES option is not there. If you comment out the "CPACK_COMPONENTS_ALL" line, it will work as expected.
Additional InformationThe issue can be fixed by modifying the PackageFile function such that any old value of CPACK_NSIS_DEFINES is stored in the "defines" variable first, before new values are appended to it. A patch is attached.
Tagspatch
Attached Filespatch file icon cpack_nsis_defines_fix.patch [^] (938 bytes) 2013-10-29 12:05 [Show Content]

 Relationships

  Notes
(0037126)
Kai Pastor (reporter)
2014-11-01 02:59

I would like to see this, too. Please solve this bug as proposed, and make CPACK_NSIS_DEFINES a documented variable. Alternatively, provide a documented CPACK_NSIS_EXTRA_DEFINES (similar to CPACK_NSIS_EXTRA_INSTALL_COMMANDS).

(I use this hook to deal with installing to 64 bit systems, i.e. as a workaround for issues related to http://public.kitware.com/Bug/view.php?id=9094 [^])
(0042406)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2013-10-29 12:05 Mark Stijnman New Issue
2013-10-29 12:05 Mark Stijnman File Added: cpack_nsis_defines_fix.patch
2013-10-31 05:13 Mark Stijnman Tag Attached: patch
2014-11-01 02:59 Kai Pastor Note Added: 0037126
2016-06-10 14:29 Kitware Robot Note Added: 0042406
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team