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?
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.
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).
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With