On 28/06/2012 11:20, Eric Noulard wrote:
2012/6/27 David Demelier <[email protected]>:

Thanks for your help, it worked!

Now, the last problem, I noticed that CPACK_PACKAGE_EXECUTABLES you
can't set an icon, thus I used my own CreateShortCut and Delete with
respectively CPACK_NSIS_CREATE_ICONS_EXTRA and
CPACK_NSIS_DELETE_ICONS_EXTRA. The first one works, but not the
second.

        set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut                       
\\\\
            '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk'           
\\\\
            '$INSTDIR\\\\sd-tris.exe'                                           
\\\\
            ''                                                                  
\\\\
            '${ICONPATH}'"
        )
        set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete                               
\\\\
            '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk'"
        )

When uninstalling, the window menu entry is still there and not
removed at all. But the project.nsi has the line

Delete                          \
            '$SMPROGRAMS\$STARTMENU_FOLDER\sd-tris.lnk'

But this command is not executed by the Uninstall.exe.

Looks like an NSIS script error.
Would you be able to create a working project.nsi (starting wiht the
one generated by CPack)
and tell us what could make the generated one work?




I finally wrote this, it works very well.

        set (ICONPATH "$INSTDIR/${PATH_INSTALL_DATA}/icon.ico")
        string(REPLACE "/" "\\\\" ICONPATH ${ICONPATH})

        set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut                  \\\\
            '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\SD-Tris.lnk'                   
\\\\
            '$INSTDIR\\\\sd-tris.exe'                                           
\\\\
            ''                                                                  
\\\\
            '${ICONPATH}'"
        )
        set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete                          \\\\
            '$SMPROGRAMS\\\\$MUI_TEMP\\\\SD-Tris.lnk'"
        )

I have an install target that install the icon.ico in the installation directory, then the CPACK_NSIS_CREATE_ICONS_EXTRA use it for the shortcut.

Cheers,

--
David Demelier


--

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