Skip to content

Commit

Permalink
[WIP] installer: use ExecAndCaptureOutput
Browse files Browse the repository at this point in the history
Innosetup 6.4 introduced a New function ExecAndCaptureOutput that
executes commands and captures there standard output and standard error
streams. We've been using our own howmgrown solution called
ExecWithCapture for this purpose, but it's a bit finicky. Switch to the
official implementation.

Signed-off-by: Matthias Aßhauer <[email protected]>
  • Loading branch information
rimrul committed Feb 22, 2025
1 parent 9518f2c commit 0c4df92
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 265 deletions.
211 changes: 0 additions & 211 deletions installer/exec-with-capture.inc.iss

This file was deleted.

19 changes: 19 additions & 0 deletions installer/helpers.inc.iss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ begin
Result[i]:=#0;
end;
// Search for the last occurence of a substring in another string or zero if not found.
// RPos exists as a preprocessor function in innosetup, but not as a scripting function.
function RPos(SubStr, S: AnyString): Integer;
var
Len,i:Longint;
begin
Len:=Length(SubStr);
i:=Length(S)-Len+1;
while i>0 do begin
If (SameStr(SubStr,Copy(S,i,Len))) then begin
Result:=i;
Exit;
end;
end;
Result:=0;
end;
function AppendToArray(var AnArray:TArrayOfString;Str:String):Integer;
begin
Result:=GetArrayLength(AnArray)+1;
Expand Down
Loading

0 comments on commit 0c4df92

Please sign in to comment.