PDA

View Full Version : Setting a Start Menu shortcut to DATABASEDIR



jwormsley
02-05-2003, 11:45 AM
I'm trying to create a Start Menu shortcut to my DATABASEDIR. The only way I can seem to create a shortcut to a folder is to use the "Shortcut to Pre-Existing File", as a normal shortcut requires an executable. When I select Taget, I can navigate to my default DATABASEDIR. But what shows up is the underlying directory name. I have a script (running at the earliest opportunity) that changes the value of DATABASEDIR, plus the user later can change it as well. The shortcut, when created, however, remains pointing at the old directory name, not the value of DATABASEDIR. I cannot edit the Target field to contain DATABASEDIR rather than its default underlying directory name. The registry key I create works fine, as it allows me to specify [DATABASEDIR] as the string value.

Anyone know how to get around this?

Chandima
02-05-2003, 05:48 PM
Couple of things you could try.

1. After you create the shortcut manually delete [ISYourDataBaseDir] from the Target property and type in [DATABASEDIR]
2. Make your VBScript change the value of ISYourDataBaseDir instead of DATABASEDIR.

Regardless of how you do it though, if the user moves the folder AFTER the setup, the shortcut will still point at the original location.

jwormsley
02-06-2003, 10:29 AM
1. After you create the shortcut manually delete [ISYourDataBaseDir] from the Target property and type in [DATABASEDIR]

You can't type in the target box. You can only select from the dialog.



2. Make your VBScript change the value of ISYourDataBaseDir instead of DATABASEDIR.

This doesn't help, either.

I have managed to get it to work sort of, at least in the case when my script finds an old install and when it is a new install, but only if the user doesn't change any paths during the install. As soon as that happens, the shortcuts are lost again.

Part of the problem is that I default DATABASEDIR to [CommonAppDataFolder]Company. I also have a folder below Company called Shared. I want the Shared folder to have the path [CommonAppDataFolder]Company\Shared no matter where I move DATABASEDIR. But if the user changes DATABASEDIR, Shared moves with it. But the shortcut does not, nor does the registry entry I created to point to it.

I may just end up having to force the users to put the program where I want it to be and not give them the opportunity to change it. I'd rather not, but I see no way of making these shortcuts work, and it is critical they exist, since [CommonAppDataFolder] is hidden and the users won't be able to browse to it.

Chandima
02-07-2003, 05:45 PM
Sorry about the first suggestion. I was testing that out on the Express 4 service pack instead of the released version. In the service pack this field is editable.

For now though I can manually make this change for you. Please send me your .ise file to chandimar@installshield.com and reset this value for you.

jwormsley
02-07-2003, 06:02 PM
Hehe, unfortunately, I got so frustrated with the whole thing, I made the installer not create any shortcuts to the data directories, only the registry keys to where they should point, then made the app create the shortcuts on the first run. This isn't wholly acceptable, since the user may not have the permissions to create the shortcuts. But I can get by with it I believe by documenting that an administrator account needs to run the app first. I could also do this with a custom action that runs at the end of the installation, I believe, since the custom action will run with administrator priviledges. I will likely need another custom action to remove the shortcuts no matter which method I end up with.

Sending the file would be fine, except I have about 5 other apps that need the same thing. I'd rather be able to do it myself. If the service pack is something freely downloadable, I'll wait till it is released and revisit this issue. For now, I believe I can work around it.