I am trying to use the uses
statement to implement something like in the following example:
uses Process;
...
var s : ansistring;
...
if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
writeln(s);
The uses
statement causes an error during compilation.
Any idea why?
There's no uses
statement in the Inno Setup/Pascal Script.
You can use only the functions listed in Inno Setup documentation.
To add new functions, you have two options:
import them from a DLL like:
procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal);
external 'MyDllFunc@files:MyDll.dll stdcall';
include them from another file using the #include
preprocessor directive.
#include "MyFunctions.pas"
Anyway, to answer your real question, use the Exec
function.
To collect an output of the executed command, see How to get an output of an Exec'ed program in Inno Setup?