问题
I have an Inno Setup script which calls a DLL. The DLL starts a thread which in the end calls a function pointer in the Inno Setup. Since i don't want to change the logic of my Inno Script to much i would like to use a semaphore or something like that.
The important part in here is that the gui shouldn't be blocked.
here a little snippet of my code
procedure InstallData();
var
arrComponents : TStringList;
i, index, p : Integer;
countComp : Integer;
begin
countComp := ICountComponents();
pbState.Max:= countComp;
arrComponents := IGetComponentsToInstall();
pbState.Max := countComp;
for i := 0 to countComp-1 do
begin
// lock semaphore
pbState.Position := i;
p := Pos(' ', arrComponents[i]);
if p > 0 then
begin
//Unzip component
//Call the DLL
end
else
begin
//unzip something else
//Call the DLL
end
end
end;
procedure ProgressCallback(progress:Integer);
begin
pbStateZip.Position:= progress;
//if progress = 100
// unlock semaphore
//
end;
Are there semaphores or is there an equivalent to this which does not block my GUI ?
来源:https://stackoverflow.com/questions/28047332/inno-setup-semaphore-non-gui-blocking