You can do something like:
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.chm"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
[Code]
function InitializeUninstall(): Boolean;
begin
Result := MsgBox('InitializeUninstall:'
if Result = False then
MsgBox('InitializeUninstall:'
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
mRes : integer;
begin
case CurUninstallStep of
usUninstall:
begin
mRes := MsgBox('Do you want to remove all files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
if mRes = IDYES then
begin
MsgBox ('Really remove the files', mbInformation, MB_OK)
DeleteFile('path\filename.ext');
End
else
MsgBox ('Don''t remove the game files', mbInformation, MB_OK);
// ...insert code to perform pre-uninstall tasks here...
end;
end;
end;
InnoSetup , . UninstallCodeExample.iss, InnoSetup.
, , . DeleteFile. DeleteFile , , [Files].