Page 1 of 1

Variables and Create Shortcut

Posted: Tue Aug 30, 2005 6:53 am
by mqk
Hi

I have question regarding variables and Create Shortcut. I defined a variable as follows:

Set Variable MYSHORTCUT to Start application


I tried to use MYSHORTCUT variable in text field: Link Name of Create Shortcut command as follows:

Create Shortcut $SHORTCUTFOLDER$\\$MYSHORTCUT$ to $UNINSTALLLINK$

But unfortunately the result was $MYSHORTCUT$ and not Start application!!!

Moreover, I got the same result, when I used variables in Title, Subject and Author of Summary Information page, and same thing in Publisher Name, Contact Name, Help link and Product Updates Link of Add-Remove Programs page.

Any help will be great,

Thanks in advance,

Best Regards,
mqk

Posted: Tue Aug 30, 2005 9:25 am
by sinan
You cannot use variables in the Project Options dialog fields. These values are hard coded. Values may only be used in the script.

As for the Create Shortcut problem...unfortunately the name of the shortcut cannot be made dynamic (variable-based), this is an MSI limitation. That is why you had that problem. Otherwise, variables work normally.

Posted: Thu Oct 19, 2006 1:13 am
by camelo
What I am doing to get around the no-variables-in-shortcuts-name problem is calling MoveFile in kernel32.dll to rename the shortcut to the desired name. The only catch is that you have to rename it back to the original name during uninstall for it to be removed as expected.

Posted: Thu Oct 19, 2006 4:22 am
by MichaelNesmith
That's pretty creative :)