Hello I like to know how can I delay a work (or a command) for a specified time in Inno Setup Pascal Script.
The built in Sleep(const Milliseconds: LongInt)
freezes all work while sleeping.
And the following function I implemented also makes the WizardForm unresponsive but not freezing like built in Sleep()
Function.
procedure SleepEx(const MilliSeconds: LongInt);
begin
ShellExec('Open', 'Timeout.exe', '/T ' + IntToStr(MilliSeconds div 1000), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
end;
I also read this, but can't think how to use it in my Function.
I like to know how can I use WaitForSingleObject
in this SleepEx
Function.
Thanks in Advance for Your Help.
Use a custom progress page (the
CreateOutputProgressPage
function):The key point here is, that the
SetProgress
call pumps a window message queue, what prevents the freezing.Though actually, you do not want the fixed-length loop, instead you use an indeterminate progress bar and query the DLL in the loop for its status.
For that, see Inno Setup: Marquee style progress bar for lengthy synchronous operation in C# DLL.