File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 115115 LogText, LeftOver: String;
116116 Memo: TNewMemo;
117117 PrevCancelButtonOnClick: TNotifyEvent;
118+ MaxIterations: Integer;
118119begin
119120 CmdlineInstallPage := CreateOutputProgressPage(' ' , ' ' )
120121 CmdlineInstallPage.Caption := caption;
@@ -147,7 +148,13 @@ begin
147148 Log(' ProcStart failed' );
148149 ExitCode := -2 ;
149150 end ;
150- while (ExitCode = -1 ) and not CmdlineInstallCancel do
151+
152+ { Following number MaxIterations is not hard defined }
153+ { it only has to be based on execution times of the instructions inside the loop and CPU ticks }
154+ { to fulfill this need heuristic technique was applied to define this number }
155+ { also, it has been taken into mind the loop has to exit within 5 minutes which is probably the maximal time user would wait }
156+ MaxIterations := 40000 ;
157+ while (ExitCode = -1 ) and not CmdlineInstallCancel and not (MaxIterations = 0 ) do
151158 begin
152159 ExitCode := ProcGetExitCode(Handle);
153160 SetLength(LogTextAnsi, 4096 );
@@ -160,6 +167,7 @@ begin
160167 end ;
161168 CmdlineInstallPage.SetProgress(0 , 100 );
162169 Sleep(10 );
170+ MaxIterations := MaxIterations - 1 ;
163171 end ;
164172 ProcEnd(Handle);
165173 finally
You can’t perform that action at this time.
0 commit comments