# Start menu and desktop shortcuts with Wix

**URL:** https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988
**Category:** Code
**Created:** [February 11, 2022, 6:50am UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988 "2022-02-11T06:50:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ocroquette](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/o/dbc845/32.png) [@ocroquette](https://discourse.cmake.org/u/ocroquette)
#### Post date: [February 11, 2022, 6:50am UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988/1 "2022-02-11T06:50:33Z")

</div>

Hi,

I needed to add desktop and start menu shortcuts to an installer using CPack and Wix and realized that the documentation is pretty bad. So I checked out CPack source code and found out the solution is easy:

> **[CMake/CPack: start menu and desktop shortcuts with Wix](https://ocroquette.wordpress.com/2022/02/11/cmake-cpack-start-menu-and-desktop-shortcuts-with-wix/)**
>
> The CMake documentation is pretty thin on the subject and the information on the internet are contradicting themselves or they work only with NSIS or other generators, so here is how to add start m…

Also, I noticed that the documentation of CPACK\_PACKAGE\_EXECUTABLES and CPACK\_CREATE\_DESKTOP\_LINKS is misleading.

[https://cmake.org/cmake/help/latest/module/CPack.html](https://cmake.org/cmake/help/latest/module/CPack.html)

Since it is a very common requirement, I think the documentation should be updated. Or did I miss something?

Cheers,  
Olivier

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 11, 2022, 10:27am UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988/2 "2022-02-11T10:27:57Z")

</div>

> [@ocroquette](#):
>
> the documentation of CPACK\_PACKAGE\_EXECUTABLES and CPACK\_CREATE\_DESKTOP\_LINKS is misleading.

Please elaborate on what is misleading so that we have the information in one place.

For primarily my own reference, [this older article of mine](https://crascit.com/2015/08/07/cmake_cpack_nsis_shortcuts_with_parameters/) about the NSIS generator mentions that one problem with `CPACK_PACKAGE_EXECUTABLES` is that you can’t specify command line arguments for those executables. This limits its usefulness. That article doesn’t mention WiX though.

---

<div class="post-metadata">

### Author: ![ocroquette](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/o/dbc845/32.png) [@ocroquette](https://discourse.cmake.org/u/ocroquette)
#### Post date: [February 11, 2022, 7:10pm UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988/3 "2022-02-11T19:10:19Z")

</div>

Hi Craig,

I could not get CPACK\_CREATE\_DESKTOP\_LINKS to work with Wix. Then I looked at the source code (Source/CPack/WiX/cmWIXShortcut.cxx) and found out about CPACK\_DESKTOP\_SHORTCUTS and got it quickly working. So I assumed that CPACK\_CREATE\_DESKTOP\_LINKS was not relevant in my case. Was it?  
Maybe a working example with CPACK\_CREATE\_DESKTOP\_LINKS and Wix would help, or more info in the documentation. From my perspective, both are overlapping, and from the documentation, it is not clear what kind of values to pass to CPACK\_CREATE\_DESKTOP\_LINKS. It is much clearer with CPACK\_DESKTOP\_SHORTCUTS.

---

<div class="post-metadata">

### Author: ![dr\_ppetrov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dr_ppetrov/32/2000_2.png) [@dr\_ppetrov](https://discourse.cmake.org/u/dr_ppetrov)
#### Post date: [February 16, 2022, 10:20am UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988/4 "2022-02-16T10:20:11Z")

</div>

“I could not get CPACK\_CREATE\_DESKTOP\_LINKS to work with Wix.” Same here, it was working just fine but suddenly no desktop icon for a long time ☹

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 16, 2022, 11:01am UTC](https://discourse.cmake.org/t/start-menu-and-desktop-shortcuts-with-wix/4988/5 "2022-02-16T11:01:56Z")

</div>

If there’s a regression, then please [open a bug report](https://gitlab.kitware.com/cmake/cmake/-/issues/new) highlighting the last CMake version in which it worked successfully for you and when it broke. Providing a minimal project which demonstrates the problem also vastly increases the chances of someone taking a look at it. 😉
