[CMake] CPack/WiX shortcuts with custom arguments

Cook, Steven (G&I) Steven.Cook at riotinto.com
Thu Mar 21 23:17:22 EDT 2019


Hi,

I'm attempting to transition from NSIS to WiX for our Windows installer and have been unable to find a way to create customised shortcuts with WiX (I would like to specify both the working directory and command line parameters).

Some approaches I've tried are:

*         Specifying CPACK_PACKAGE_EXECUTABLES, and then using CPACK_WIX_PATCH_FILE to modify the shortcut. This approach doesn't work because the patching mechanism can only add new XML tags; it is unable to add or modify properties on existing tags.

*         Creating the shortcut myself via CPACK_WIX_EXTRA_SOURCES. This doesn't work because PROGRAM_MENU_FOLDER is not defined in directories.wxs unless cpack is creating shortcuts itself. And I can't define this directory myself because the patching mechanism doesn't allow modifications to the top level TARGETDIR directory.

Ideas of things that might work but which are not ideal:

*         Create an unwanted shortcut with cpack and then define my own shortcuts with CPACK_WIX_EXTRA_SOURCES. But then there is an unwanted shortcut.

*         Create separate .bat files for each start menu item so that working directory and command line parameters are not required.

Is there anything else I can try?

Thanks
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190322/31e9f4e8/attachment.html>


More information about the CMake mailing list