Hi,

Thanks you for the answer,
Actually i choose to not alterate the NSIS.template.in file.

I perfer adding my own custom commands that will modify the project.nsi file used
to generate the installer :
Here is what i did to custom my cpack installer, it may help someone...

To create a sub-directory in your project start menu  folder
this command was useful :

SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS 
  " CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\YourDirectory\\\"")

To put a shortcut to a file , in the subdirectory "Your directory"

SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS  
    " CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\YourDirectory\\\\shortcut.lnk\\\"  \\\"$INSTDIR\\\\bin\\\\file.exe\\" \n ")

Don't forget to tell cpack to add the "shortcut.lnk"  in the uninstall routine by doing this :

SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS   
    "${UNINSTALL_LIST} \n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\YourDirectory\\\\shortcut.lnk\\\"

You have also to remove the "YouDirectory" when uninstalling :

SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS  "${UNINSTALL_LIST} \n RMDir  \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\YourDirectory\\\" ")

It works fine for win7 and XP.
Regards,
Otmane


David Cole a écrit :
On Mon, Dec 6, 2010 at 3:37 AM, Otmane Lahlou <otmane.lah...@c-s.fr> wrote:
  
Hi,

I've got no answer for this,

Can someone tell me whether doing this with CMake is possible.

    

Yes, it is possible. I do not have time to go into details and tell
you exactly how to do it, but if the built-in functionality provided
by CPACK_PACKAGE_EXECUTABLES and CPACK_NSIS_MENU_LINKS do not give you
sufficient control, you can always customize the NSIS input file that
CPack uses to tell NSIS how to build the installer.

See these threads that talk about customizing NSIS.template.in:
http://www.cmake.org/pipermail/cmake/2007-January/012649.html
http://www.cmake.org/pipermail/cmake/2010-July/037862.html
http://www.mail-archive.com/cmake@cmake.org/msg13128.html
http://www.mail-archive.com/cmake@cmake.org/msg28390.html

( All found by googling for "customize cpack nsis template" )


HTH,
David


  
Thanks
Otmane


Otmane Lahlou a écrit :
    
Hi List,

When packaging my project, i want my project in the start menu to be
organised
in several directories  :

In  the windows StartMenu i'd like to have something like that :

StartMenu -> Programs -> MyProject ->   Directory1 -> {My stuffs 1}

 Directory2 -> {My stuffs 2}
                                                                 Uninstall

Here what i did : - I edit the variable CPACK_PACKAGE_EXECUTABLES with the
executables name and their label :
  "exe1"  "Description of exe1"
   ....
- In case of Windows, i  used CPACK_NSIS_MENU_LINKS to have my shortcuts
in the startmenu.
 Here is the point; i did not succed to use this macro to get the
subdirectories organisation.
 but i have all the executables in the root directory MyProject :

 StartMenu -> Programs -> MyProject ->   My stuffs 1
                                                                  My
stuffs 2

Uninstall

Any hints to do that?
Thanks

Otmane
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


      
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

    


  

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to