cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mary_v
Level 6

Creating Shortcuts

Hi,

how can i create shortcuts while uninstalling (certainly depending on conditions)?

my shortcuts don't seem to be created...

mary
Labels (1)
0 Kudos
(8) Replies
Lurean
Level 8

maybe I am confused. Why would you need to create a shortcut while uninstalling? and what would the shortcut be pointing to since your application is not there anymore?
0 Kudos
mary_v
Level 6

Lurean,

the situation is:

i am installing a "main" installation (server) and a "secondary" installation (client)

if both are on the same pc, i want on uninstall of the secondary setup a shortcut in programmenufolder which points to the setup.exe of the secondary installation in case one would want to reinstall the client (which is needed) again.

so my scope is to set a shortcut "on uninstall" of my client setup.

mary
0 Kudos
ericpaul
Level 6

Why don't you just always include the shortcut in your server install.

If, after installing your server, you want to install the client the user can install the client by just clicking the shortcut.
Of course, the client install already has to be on the system.

For your example where the server and client are installed on the same machine, clicking the shortcut will just open the setup (presumably) with the options Modify, Repair and Remove.
In case the client has already been removed, it will install the client again.

If this is a workable solution, you don't have to install the shortcut on uninstall.
0 Kudos
mary_v
Level 6

hi ericpaul,

thanks for this interesting approach - unfortunately it's a little bit more tricky (i omitted some information yet):

first, when the serverinstall runs successfully, a programmenufolder with a shortcut to the client setup.exe is created.

on step 2, you can click on this link to install the client AND the above mentioned link is deleted (other shortcuts are created)

step 3, if you uninstall the client setup, the whole programmenufolder is deleted
and that's the point where i wanted to create a new shortcut (without knowing as user where to search in the filesystem for the server setup.exe) because the originally installed server setup exists yet.

mary
0 Kudos
cbragg
Level 7

Putting to one side that this feels a little nasty and you may want to rethink your design....

You won't be able to do that using standard out of the box functionality. The reason being is that the shortcuts are linked to components. If you install a component with a related shortcut it will create the shortcut, if you uninstall a component the shortcut gets removed.

So what you would need to do is install a component during uninstall... Obviously no can do!

Therefore the only way you could get around your situation is to manually create a custom action that will create a shortcut for you that is conditioned to run on uninstall.

But again... please reconsider this design in the first place.
0 Kudos
mary_v
Level 6

well, how would i manually create a shortcut - i didn't find a way...?

...and...

i already considered a redesign but have not found a better way for my "problem" (in fact, it's only for the convenience of our users).

who could give me another clue?

thanks for all your suggestions so far!

mary
0 Kudos
cbragg
Level 7

When i say create a shortcut manually i meant using something like a vbscript custom action.

This website has some good code on this:

http://techtasks.com/code/viewbookcode/518
0 Kudos
Lurean
Level 8

another option would be to have the "server" Installation install a shortcut to the client installer instead of having an installer try to create a shortcut to itself at uninstall, which is essentially what you are suggesting.

Yes, this will mean the shortcut is there even when the client is installed, but running the install a second time will bring up the maintenance mode and not really cause any problems in most cases.
0 Kudos