Inno Setup Semaphore non GUI Blocking

核能气质少年 提交于 2019-12-24 10:48:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!