MantisBT - CMake
View Issue Details
0007828CMakeCPackpublic2008-10-19 02:132011-06-06 18:25
Sam Baker 
David Cole 
normalminoralways
closedfixed 
CMake-2-6 
CMake 2.8.4CMake 2.8.4 
0007828: Impossible to create a Nullsoft installer without referencing bin folder
As reported to the mailing list, my project has an install that doesn't include a bin folder. An exe and its dlls go in the root directory.

The lack of bin folder means that I can't use CPACK_PACKAGE_EXECUTABLES for my executable. However if I don't include CPACK_PACKAGE_EXECUTABLES, then CPACK_NSIS_MENU_LINKS doesn't work. If I add a dummy entry for CPACK_PACKAGE_EXECUTABLES then my menu links show up so that is the workaround that I'm using now. It causes a bogus entry in my start menu folder though. The example install and cpack is below.

I'm building with CMake 2.6.2 on Win XP using Visual Studio 2008.

#
# Configure the install
#
INSTALL(TARGETS MyApp
    RUNTIME DESTINATION .
    LIBRARY DESTINATION .
    ARCHIVE DESTINATION .)

INSTALL(FILES ${MYAPP_ROOT_DIR}/plugins.cfg ${MYAPP_ROOT_DIR}/plugins_debug.cfg DESTINATION .)
INSTALL(DIRECTORY ${MYAPP_ROOT_DIR}/assets DESTINATION .)
# Add Microsoft runtime
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
INCLUDE(InstallRequiredSystemLibraries)
INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION .)

#
# Configure the installer
#
set(CPACK_PACKAGE_NAME "My application")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 1)
set(CPACK_PACKAGE_DESCRIPTION_FILE ${MYAPP_ROOT_DIR}/installer/packagedescription.txt)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "My App")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "My App")
set(InstallerPath ${MYAPP_ROOT_DIR}/installer/)
set(CPACK_RESOURCE_FILE_LICENSE ${InstallerPath}license.txt)
set(CPACK_RESOURCE_FILE_WELCOME ${InstallerPath}welcome.txt)
set(CPACK_NSIS_MENU_LINKS "./MyApp.exe" "Run the application")
set(CPACK_PACKAGE_EXECUTABLES "I AM CONFUSED" "I DO NOTHING")
set(CPACK_NSIS_DISPLAY_NAME "Install Application!")
set(CPACK_NSIS_CONTACT "sam.baker@bigfishgames.com")
SET(CPACK_NSIS_MUI_ICON "${InstallerPath}\\\\logo.ico")
SET(CPACK_NSIS_MUI_UNIICON "${InstallerPath}\\\\logored.ico")
SET(CPACK_PACKAGE_ICON "${InstallerPath}\\\\logo.bmp")
include(CPack)
From David Cole:

It appears to be a bug... We'll have to keep supporting the "bin" folder for backwards compatibility, but I think it would be a great feature request to use CPACK_PACKAGE_EXECUTABLES without requiring a "bin" folder.


And the CPACK_NSIS_MENU_LINKS should work regardless of use of CPACK_PACKAGE_EXECUTABLES.


Would you be willing to submit a bug and a feature request to the bug tracker on these two issues? If you have time, great, do it and assign them to me. Otherwise, I will try to put these into the bug tracker and/or fix them in the CMake code base.


Thanks for the report,
David Cole
No tags attached.
related to 0010644closed David Cole problem using CPACK_NSIS_MENU_LINKS with non-http urls 
has duplicate 0010591closed David Cole For NSIS, CPack erroneously enforces a ..\bin\ folder 
related to 0007829closed David Cole CPACK_PACKAGE_EXECUTABLES should allow executables from anywhere 
Issue History
2008-10-19 02:13Sam BakerNew Issue
2008-10-20 10:25David ColeStatusnew => assigned
2008-10-20 10:25David ColeAssigned To => David Cole
2009-01-14 06:30daedalusfallNote Added: 0014552
2009-01-16 00:23Sam BakerNote Added: 0014581
2009-02-19 11:05David ColeNote Added: 0015219
2009-02-19 11:05David ColeSeveritymajor => minor
2010-11-10 21:09David ColeTarget Version => CMake 2.8.4
2010-12-14 18:59David ColeRelationship addedhas duplicate 0010591
2011-01-06 09:07Mike McQuaidNote Added: 0024455
2011-01-06 17:05David ColeNote Added: 0024499
2011-01-07 14:34David ColeRelationship addedrelated to 0010644
2011-01-07 14:48David ColeNote Added: 0024510
2011-01-07 14:48David ColeStatusassigned => resolved
2011-01-07 14:48David ColeFixed in Version => CMake 2.8.4
2011-01-07 14:48David ColeResolutionopen => fixed
2011-01-07 17:38David ColeRelationship addedrelated to 0007829
2011-06-06 18:25David ColeStatusresolved => closed
2011-06-06 18:25David ColeNote Added: 0026702

Notes
(0014552)
daedalusfall   
2009-01-14 06:30   
Came across the same problem, and googling led me here... (cmake variables are surprisingly hard to get docs on it seem, maybe I'm just looking in the wrong places... but I digress)

your stop-gap solution:
set(CPACK_PACKAGE_EXECUTABLES "I AM CONFUSED" "I DO NOTHING")

which creates a dummy shortcut that points to nothing can be changed to
set(CPACK_PACKAGE_EXECUTABLES "" "")

And then NO extra shortcuts are made in the start menu. I haven't had any problems using this work around (though its still not ideal).

Just thought I'd post here for anyone else who is having this problem.
(0014581)
Sam Baker   
2009-01-16 00:23   
Thanks for the fix daedalusfall. That makes the workaround much more practical for me.

David, I've confirmed that the change also works for me and gets rid of the useless link in my app's start menu folder.
(0015219)
David Cole   
2009-02-19 11:05   
Setting Severity to "minor" since there is a workaround.
(0024455)
Mike McQuaid   
2011-01-06 09:07   
Pull request created at https://github.com/Kitware/CMake/pull/2 [^]
(0024499)
David Cole   
2011-01-06 17:05   
The hard-coded "bin" referred to in this issue was replaced by a CPack variable expansion in this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=702c8f8ba79591744449244ed47a5181fdf68a63 [^]

This commit should appear in the CMake 2.8.4 release.

I am still leaving this issue open, though, until I look at the CPACK_NSIS_MENU_LINKS portion of the complaint. Should be soon...
(0024510)
David Cole   
2011-01-07 14:48   
The remainder of this issue is fixed (using CPACK_NSIS_MENU_LINKS without having to use CPACK_PACKAGE_EXECUTABLES) by:

Fixed in this git commit, just pushed to 'next':
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1bbe4e69171f3155f262bb12f15437db4b71c207 [^]

Should make it into 2.8.4...
(0026702)
David Cole   
2011-06-06 18:25   
Closing resolved issues that have not been updated in more than 3 months.