inno-setuppascalscript

Using the "uses" statement in Inno Setup Code section


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?


Solution

  • 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:


    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?