Variables and Create Shortcut

Got a problem you cannot solve? Try here.
Post Reply
mqk
Posts: 18
Joined: Mon Aug 15, 2005 7:57 am

Variables and Create Shortcut

Post 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
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post 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.
camelo
Posts: 7
Joined: Sun Jul 23, 2006 11:17 pm

Post 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.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

That's pretty creative :)
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply