I have referenced How to get an output of an Exec'ed program in Inno Setup?. But my txt file always empty.
Here is my script:
[Code]
function MyTest(): Boolean;
Var
TmpFileName: String;
ExecStdout: AnsiString;
ResultCode: Integer;
begin
TmpFileName := 'C:\Users\My\Desktop\123.txt';
Exec('C:\Users\My\Desktop\devcon.exe', 'help find > "' + TmpFileName + '"', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode);
if LoadStringFromFile(TmpFileName, ExecStdout) then
begin
MsgBox(ExecStdout, mbInformation, MB_OK);
end;
//DeleteFile(TmpFileName);
Result := true;
end;
function InitializeSetup(): boolean;
begin
MyTest;
Result := true;
end;