Hello,
In the past I did this using
MakePendingFileRenameOperationsChecksum
and returning a custom error code.
If a file is in use and the user selects ignore, then Inno setup will set a reboot pending flag.
Example script:
Source: "MyProg.exe"; DestDir: "{app}";
Source: "MyProg.chm"; DestDir: "{app}"; Flags: restartreplace;
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme;
[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
[Code]
var
Restarted: Boolean;
ChecksumBefore: String;
ChecksumAfter: String;
procedure ExitProcess(exitCode:integer);
external 'ExitProcess@kernel32.dll stdcall';
procedure ReturnRebootNecessary();
begin
ExitProcess(9);
end;
function InitializeSetup(): Boolean;
begin
ChecksumBefore := MakePendingFileRenameOperationsChecksum;
Result := True;
end;
procedure DeinitializeSetup();
begin
ChecksumAfter := MakePendingFileRenameOperationsChecksum;
if ChecksumBefore <> ChecksumAfter then
begin
ReturnRebootNecessary();
end;
end;
Thanks.