Join us for SoftSummit 2023. The 20th anniversary of the industry leading software monetization conference. April 18 and 20. Register Now

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 4

Removed old shortcuts

Hi all,

I have created a new minor setup of a basic installshield project, and some shortcut names have been changed. Now if I upgrade the installation, I have duplicated shortcuts in my application's programm group.

Is there any easy why to remove the old shortcuts, or replace them by the new ones?

Labels (1)
0 Kudos
2 Replies
Level 10 Flexeran
Level 10 Flexeran

You could either author entries into the RemoveFile table of your project that specifies the shortcut LNK files to be deleted, or you could use a custom action (VBScript, DLL, EXE, InstallScript, etc.) that deletes these files for you. You can find information on the RemoveFile table in the following article:
RemoveFile Table -

Another approach would be to author a major upgrade instead of a minor upgrade, which will uninstall the existing installation and then install the new installation, eliminating the need to author the RemoveFile table or a custom action.
0 Kudos
Level 4

I tried a major upgrade before as well, it didn't remove the install files - but I did not choose to remove first and install then, I use install first, then remove unused files.

However during meantime I searched arround a lot of threads in this forum and found a good way to remove my old shortcuts. For all others searching, here is what todo:

1. Create a new Installscript file, call the function ExFn_DeleteFolderIcon for example. Then use the DeleteFolderIcon to remove your legacy shortcuts, do not check for the error code (only for testing maybe), because the function will kindly fail if the shortcut is not available. Here is a sample function:

function ExFn_DeleteFolderIcon(hMSI)
// To Do: Declare local variables.

// Delete Legacy Icons just in case!
DeleteFolderIcon (FOLDER_PROGRAMS + "\\MyProgram", "Old Client Shortcut");
DeleteFolderIcon (FOLDER_PROGRAMS + "\\MyProgram", "Old manual Shortcut");


"Old Client Shortcut" and "Old manual Shortcut" are of course the old shortcutnames.

Now you need to create a new custom action. Call the Action RemoveOldShortCuts for example, perform the wizard (select Installscript, select the functionname and so on. Only add the Action into a suitable position in the Install Exec Sequence, I used After Create Shortcuts to make sure the FOLDER_PROGRAMS is available.

I hope this helps others with the same problem.
0 Kudos