hi all,

i have a MSI file for the distributor that i need to locate the shortcut to some other directory. i don't wish to create a MST file just for that.

is there a way to redirect the shortcut?

so far, i have tried;

msiexec /i TheMsiFile SHORTCUTDIR="[ProgramMenuFolder]\TheShortCutDir

but it's not working.

how can i do this?

0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Hi kardoc,
this isn't going to work in a 'normally' authored MSI because there is no public property for the shortcut directory.
In our environment, we alter the shortcut directory for all apps that we deploy. But this isn't just easy property setting, because you have to remember somehow, where you exactly pointed that link when people during the setup alter that path (which is the reason you want to do that). Otherwise, with a repair or reinstall, a (second) new directory with the path stored in the directory table will be created and the the links placed there too.

We do the following:
create a 'SHORTCUTDIR' property and alter the directory table accordingly.

This line goes to the Directory Table:
SHORTCUTDIR ProgramMenuFolder YOUR~1|Your App Dir

Shortcuts Table changes:
YourApp SHORTCUTDIR YOUR1~1|Your App yourapp.exe FeatureX Icon.exe 0 1

The remembering part goes as follows:

Add this line to the AppSearch table:

Add this line to the RegLocator table:
SC_Dir 2 Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode] ShortcutDirectory 0

Add this line to the Registry Table:
RegHKLM1 2 Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode] ShortcutDirectory [SHORTCUTDIR] YourComponentX
(You need to alter the last part of the line, which has to be a valid component of your app. Normally, you can use the component, as the main .exe is associated with.)

To make this changes, use ORCA from the SDK.

With this you can set a property on the command line. If you need a dialog to set it, you have to author it by your self, but this need in deep knowledge of MSI-Files.

Hope this helps.
Regards, Nick
Answered 01/11/2007 by: nheim
Tenth Degree Black Belt

Please log in to comment
thanks, these are great info! i will keep them for future reference.

but just for 1 shortcut, it will be easier to only create the mst file.

Answered 01/11/2007 by: kardock
Second Degree Green Belt

Please log in to comment