Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the default name of an Inno Setup uninstaller to avoid naming conflicts

I need to install a couple of installers in the same directory so it conflicts with the Inno Setup uninstaller name unins000.exe and unins000.dat

Is there a way to change the default name of an Inno Setup uninstaller?

like image 350
ElektroStudios Avatar asked Sep 04 '13 23:09

ElektroStudios


4 Answers

Inno Setup does not offer any way to let you name (or rename) the uninstaller. Inno Setup takes care of naming conflicts on its own.

Also note that when you try to rename the uninstaller manually (like some answers here do), you break the reference to the uninstaller in Add or remote application in Control Panel.

Even if you fix the reference, there's another problem. When you upgrade later, the new installer won't find logs of the previous installer and won't be able to merge them. Consequently a future uninstallation won't completely remove the application. See the Appending to Existing Uninstall Logs in Inno Setup documentation.

like image 134
Martin Prikryl Avatar answered Oct 06 '22 01:10

Martin Prikryl


Just dealt with this myself. You shouldn't move the uninstaller executable itself around, for reasons Martin Prikryl pointed out. But I agree it is unsatisfying to have a bunch of numbered uninstallers sitting in a directory with no obvious means of telling which is which.

There is a solution using the facilities Inno Setup provides. In the [Setup] section:

[Setup]
...
UninstallFilesDir=Uninstall\exe\{#NAME_OF_APP}
...

Then in the [Dirs] section:

[Dirs]
...
Name: Uninstall\exe; Attribs: hidden;
Name: Uninstall\exe\{#NAME_OF_APP}; Attribs: hidden;
...

And finally you create named shortcuts in [Icons] that point to the uninstallers which will always have the same name because you've sequestered them:

[Icons]
...
Name: Uninstall\{#NAME_OF_UNINSTALLER}; Filename: Uninstall\exe\{#NAME_OF_APP}\unins000.exe
...

This leaves references in the OS to the uninstallers alone, hides the confusing executable names in a folder the user won't usually see but can still access, and provides named, descriptive shortcuts that can all live in the same folder. You can also give the shortcuts a good icon. For good measure, maybe drop an extra README in the \exe directory to explain what is going on just in case someone gets nosey (they will, naturally).

like image 34
MikeTheCoder Avatar answered Nov 06 '22 04:11

MikeTheCoder


No. 'unins' is hard-coded in the name generation procedure of the executable, data and msg files, in GenerateUninstallInfoFilename' procedure in 'install.pas' of inno-setup sources.

GenerateFilenames sub procedure has this:

BaseFilename := AddBackslash(BaseDir) + Format('unins%.3d', [I]);
UninstallExeFilename := BaseFilename + '.exe';
..

Where 'I' is an integer and 'BaseDir' is derived from UninstallFilesDir which you can change.

like image 10
Sertac Akyuz Avatar answered Nov 06 '22 05:11

Sertac Akyuz


Inno does this automatically when it detects a different application being installed into the same directory (based on a different AppID). There should be no need to go behind its back and rename the uninstaller files.

like image 7
Deanna Avatar answered Nov 06 '22 06:11

Deanna