# CPack + WiX - setting working directory for desktop and menu shortcuts?

**URL:** https://discourse.cmake.org/t/cpack-wix-setting-working-directory-for-desktop-and-menu-shortcuts/1846
**Category:** Code
**Created:** [September 15, 2020, 2:41pm UTC](https://discourse.cmake.org/t/cpack-wix-setting-working-directory-for-desktop-and-menu-shortcuts/1846 "2020-09-15T14:41:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![starseeker](https://discourse.cmake.org/user_avatar/discourse.cmake.org/starseeker/32/4923_2.png) [@starseeker](https://discourse.cmake.org/u/starseeker)
#### Post date: [September 15, 2020, 2:41pm UTC](https://discourse.cmake.org/t/cpack-wix-setting-working-directory-for-desktop-and-menu-shortcuts/1846/1 "2020-09-15T14:41:30Z")

</div>

Hi! I’m trying to match the functionality of our CPack/NSIS installer using CPack + WiX, and I’ve hit a bit of a tricky point.

I’d like to alter the default working directory for applications launched via desktop and menu shortcuts so that the default directory is the user’s home directory. In CPack+NSIS this can be done by customizing the NSIS template to do “SetOutPath $PROFILE” right before “CreateShortcut”, but so far I’ve not figured out how to achieve a similar effect with CPack and WiX. I’ve found

> <https://github.com/PowerShell/PowerShell/pull/6043>

but they’re not using CMake and it’s not immediately clear to me what the best way would be to tie that into a CPack+WiX setup.

Has anyone done this? I’m hoping this is a reasonably standard thing to do (maybe with some application of `CPACK_WIX_PATCH_FILE`?) and I’ve just not found the right keywords to identify examples…

Thanks for any assistance - if this isn’t a typical thing to do for a WiX installer I’ll roll up my sleeves and dig into the custom template approach, but I wanted to check before diving into the deep end…
