PDA

View Full Version : conditional removal of my start menu shortcuts



ahoria
03-10-2005, 11:01 AM
I need to create a Start menu shortcut to a shared product. That is an exe file that is installed by one or more products and removed only when all products are uninstalled. I do this by keeping a reference count to that shared product (in the SharedDLLs section of the Registry).

The shortcut should have the same behavior, that is it should not be uninstalled unless all products are removed. However, since this shortcut is shared, if I uninstall one product then the shortcut is removed. Does IS have a way to prevent shortcut removal? I just want to uninstall the shortcut when all the products that use the exe file have been removed.

Perucho
03-10-2005, 05:04 PM
Instead of using the IDE to create the shortcuts, what if you do it using Installscript code? i.e. AddFolderIcon() function.

RadhaK
03-11-2005, 12:30 AM
Hi,

You can use DeleteFolderIcon to remove shortcuts from folder.
Create Installscript which calls DeleteFolderIcon function and call this installscript in custom action.

To remove shortcut during complete uninstallation, you can run custom actions only during uninstallation as below.

To make sure that a custom action runs only if the user has chosen uninstallation, you should use the MSI REMOVE property. This property can be used as a condition. The REMOVE property resolves to true if a feature has been selected to be removed during maintenance mode. To only run a custom action if a particular feature is set for uninstall, you can use this condition REMOVE AND &featurename = 2. This evaluates to true if the feature is set to INSTALLSTATE_ABSENT. The custom action must be placed after the InstallValidate standard action in the Installation\Execute sequence.

Check the below Installshield Helpnet article to know more about DeleteFolderIcon function.

http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield10-5langref/LangrefDeleteFolderIcon.htm

Check the below Installshield Knowledge Based article to know more about Running Custom Actions Only During Uninstallation.

http://support.installshield.com/kb/view.asp?articleid=q105456