Inno Setup supports installing multiple applications in the same directory, so the uninstaller files are automatically named Unins000.exe,unins001.exe,unins002.exe and so on according to the order in which they are installed. This is the function of Inno SETUP itself. See Http://www.jrsoftware.org/iskb.php?uninstallername.
Once the installation process is complete, you can of course change the name of the uninstall file to any other file name, noting that you want to change the Unins00X.exe and Unins00X.dat in the installation directory as well as the relevant uninstallation information in the registry. Because the actual location and name of the uninstaller file can be represented by the constant {Uninstallexe}, you can have your installer automatically make these changes, as shown in the sample script.
The following is the quoted content:; Inno Setup Script
; The sample script shows how to customize the name of the unload file (default is Unins000.exe,unins001.exe, and so on).
[Setup]
Appname= Custom Uninstall file name sample program
Appvername= Custom Uninstall File name Example Program 1.0
defaultdirname={pf}/Custom Uninstall file name sample program
Defaultgroupname= Custom Uninstall file name sample program
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "Myprog.hlp"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"
[CODE]
Procedure curstepchanged (Curstep:tsetupstep);
Var
Uninspath, Uninsname, Newuninsname, myappname:string;
Begin
If Curstep=ssdone Then
Begin
Specify a new Uninstall file name (with no extension), modify it accordingly!
Newuninsname: = ' unload ';
The application name, and the [SEUTP] segment of the AppName must be the same, please modify the corresponding!
Myappname: = ' Custom uninstall file name sample program ';
Rename the uninstall file below
uninspath:= Extractfilepath (Expandconstant (' {uninstallexe} '));
uninsname:= Copy (Extractfilename (Expandconstant (' {uninstallexe} ')), 1,8);
RenameFile (Uninspath + uninsname + '. exe ', Uninspath + newuninsname + '. exe ');
RenameFile (Uninspath + uninsname + '. Dat ', Uninspath + newuninsname + '. dat ');
Modify the appropriate registry content as follows
If Regkeyexists (HKEY_LOCAL_MACHINE, ' software/microsoft/windows/currentversion/uninstall/' + MyAppName + ' _is1 ') then
Begin
Regwritestringvalue (HKEY_LOCAL_MACHINE, ' software/microsoft/windows/currentversion/uninstall/' + MyAppName + ' _is1 ' , ' uninstallstring ', ' "' + Uninspath + newuninsname + '. exe ');
Regwritestringvalue (HKEY_LOCAL_MACHINE, ' software/microsoft/windows/currentversion/uninstall/' + MyAppName + ' _is1 ' , ' quietuninstallstring ', ' "' + Uninspath + newuninsname + '. exe"/silent ');
End
End
End
Inno Setup to customize the script for uninstalling file names