Skip to content

Commit 8d18d60

Browse files
committed
[WIP] installer: use ExecAndCaptureOutput
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]>
1 parent 9518f2c commit 8d18d60

File tree

3 files changed

+84
-265
lines changed

3 files changed

+84
-265
lines changed

Diff for: installer/exec-with-capture.inc.iss

-211
This file was deleted.

Diff for: installer/helpers.inc.iss

+19
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,25 @@ begin
5454
Result[i]:=#0;
5555
end;
5656
57+
// Search for the last occurence of a substring in another string or zero if not found.
58+
// RPos exists as a preprocessor function in innosetup, but not as a scripting function.
59+
function RPos(SubStr, S: AnyString): Integer;
60+
var
61+
Len,i:Longint;
62+
begin
63+
Len:=Length(SubStr);
64+
65+
i:=Length(S)-Len+1;
66+
while i>0 do begin
67+
If (SameStr(SubStr,Copy(S,i,Len))) then begin
68+
Result:=i;
69+
Exit;
70+
end;
71+
end;
72+
73+
Result:=0;
74+
end;
75+
5776
function AppendToArray(var AnArray:TArrayOfString;Str:String):Integer;
5877
begin
5978
Result:=GetArrayLength(AnArray)+1;

0 commit comments

Comments
 (0)