Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming/replacing ShortCut During Inno Setup Installation

Tags:

inno-setup

The [InstallDelete] Section enables files to be deleted but does not enable icons to be deleted (the only Type supported is files, I was hoping it also supported icons).

I need to change the shortcuts that are associated the programs being installed. I can add a new shortcut (e.g. 'Maintenance') by adding the appropriate parameters to the [Icons] section but have not found a way of removing the old shortcut (e.g. 'Repair').

Has anyone got any ideas how this can be acheived without delving into the Registry - I am familiar (but certainly not an expert) in the use of Pascal Scripting.

like image 804
S L Bentall Avatar asked Oct 22 '22 15:10

S L Bentall


1 Answers

"Icon" aka Shortcut is just .lnk file placed somewhere - e.g. on your Desktop - pointing to other file - e.g. Program.exe - in {app} directory.

If you create such "icon" in [Icons] section it is automatically deleted during uninstall (unless the uninsneveruninstall Flag is set).

If you have some "icon" which you want to delete then simply delete the .lnk file from destination folder (e.g. Desktop). You can do that in [InstallDelete] or [UninstallDelete] or programatically in [Code] section:

[InstallDelete]
Type: files; Name: "{commondesktop}\My Program.lnk"

where "{commondesktop}\My Program.lnk" is the path\name of the icon (actually the name of the .lnk file) to delete.

like image 180
Slappy Avatar answered Oct 25 '22 19:10

Slappy