How to create multiple shorcuts to the same target

Got a problem you cannot solve? Try here.
Post Reply
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

How to create multiple shorcuts to the same target

Post by KevinTX »

Hi,

My installer needs to create a shortcut (to the same target file) in each of the Photoshop's Plug-ins directory. See the following code example:

Code: Select all

Read Registry Key HKLM\SOFTWARE\Adobe\Photoshop\10.0\PluginPath\ into PSPLUGINDIR
if Variable PSPlUGINDIR not Equals
   Create Shortcut $PSPLUGINDIR$\myplugin to $TARGETDIR$\Plugins\myplugin
end
Read Registry Key HKLM\SOFTWARE\Adobe\Photoshop\11.0\PluginPath\ into PSPLUGINDIR
if Variable PSPlUGINDIR not Equals
   Create Shortcut $PSPLUGINDIR$\myplugin to $TARGETDIR$\Plugins\myplugin
end
Read Registry Key HKLM\SOFTWARE\Adobe\Photoshop\12.0\PluginPath\ into PSPLUGINDIR
if Variable PSPlUGINDIR not Equals
   Create Shortcut $PSPLUGINDIR$\myplugin to $TARGETDIR$\Plugins\myplugin
end
Only the last Create Shortcut actually did the creation. The first two did not create any shortcut (all three registry keys exist and have valid values).
Also, I would like to use Goto Label command to do a loop, but it does not allow defining label inside conditional statement.

Thanks,
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: How to create multiple shorcuts to the same target

Post by mills »

The reason only the last link is being created is because the shortcuts aren't created until Apply Install is called.
Thus, the value of PSPLUGINDIR at that time is whatever it was last set to.

I do think that is by designed, but I see where you're coming from, so I'll double check whether the script should behave in such a way as to remember a variable's value at the time it was called.

In the mean time, just use a unique variable for each path.

~~~

The help doc does state "If the GoTo Label is called while inside a conditional block, the block will be immediately exited."

So, let me see what's going on there...
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

Re: How to create multiple shorcuts to the same target

Post by KevinTX »

Thanks. Using different variable for each path works.
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: How to create multiple shorcuts to the same target

Post by mills »

I found that using the same variable to store the path will work if the name of each shortcut differs.

As for the label issue, are you getting the following message when compiling:
LABEL_error.jpg
LABEL_error.jpg (28.2 KiB) Viewed 4856 times
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

Re: How to create multiple shorcuts to the same target

Post by KevinTX »

Yes, that is exactly the error message that I was getting.
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: How to create multiple shorcuts to the same target

Post by mills »

Then, you must be defining a label within an if block. You can place GoTo statements in an if block, but not a label definition.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Post Reply