Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a shortcut using wix that could change depending on a user's system

Tags:

c#

shortcut

wix

I have created a Wix installer that places 3 shortcuts onto the desktop. One of these shortcuts references the user's DVD Drive. Is there a way to dynamically set the target of this shortcut based on that drive letter? Would a custom action be the way to go? If so how would I change the target of a shortcut using that custom action. I have been writing my custom actions in C# and would hope to continue doing so.

Thanks for any help.

like image 914
Scott Boettger Avatar asked Nov 06 '22 17:11

Scott Boettger


1 Answers

You can set the target of a shortcut with the value of a property. For example, the following will take the value of the MYSTUFF property as the target:

<Shortcut Id="MyStuffShortcut" Name='My Stuff' Target="[MYSTUFF]" />

There is no standard windows installer property for "the DVD drive". I'm not sure what that would even mean if there were multiple DVD drives. You can use ROOTDRIVE to refer to the local drive with the most free space. You can use SourceDir to refer to the root of the drive where the installer is being executed from.

like image 59
Wim Coenen Avatar answered Nov 14 '22 07:11

Wim Coenen