質問

I want an entry for release_notes.txt or release_notes.html in the start-menu. When I select the release_notes entry in the menu the text file shall apear in notepad or the html fill in a web browser. But I can't figure out how to write the commands in CMakeLists.txt to do that.

役に立ちましたか?

解決

Are you using CPACK_NSIS_MENU_LINKS?

Or you could use CPACK_NSIS_EXTRA_INSTALL_COMMANDS...

他のヒント

Not sure if current versions of CMake provide an easier/different way, but this is what we do:

SET( CPACK_NSIS_CREATE_ICONS_EXTRA 
"
CreateShortcut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\SDK Documentation.lnk\\\" \\\"$INSTDIR\\\\doc\\\\html\\\\index.html\\\"
" )

SET( CPACK_NSIS_DELETE_ICONS_EXTRA 
"
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\SDK Documentation.lnk\\\"
" )

Similar to Johannes' answer, CPACK_NSIS_CREATE_ICONS_EXTRA and CPACK_NSIS_DELETE_ICONS_EXTRA is a flexible way to manage shortcuts (Start menu, desktop, etc.), including adding command-line arguments if required. This short article gives a bit more information. It uses a slightly different path for the delete link with an explanation for why. It also includes links to NSIS documentation to show other places you can create shortcuts, etc.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top