在 Inno Setup 代码部分使用 "uses" 语句
Using the "uses" statement in Inno Setup Code section
我正在尝试使用 uses
语句来实现类似以下示例的内容:
uses Process;
...
var s : ansistring;
...
if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
writeln(s);
uses
语句导致编译时出错。
知道为什么吗?
Inno Setup/Pascal 脚本中没有 uses
语句。
您只能使用 functions listed in Inno Setup documentation。
要添加新功能,您有两种选择:
-
procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal);
external 'MyDllFunc@files:MyDll.dll stdcall';
使用 #include
preprocessor directive.
从另一个文件中包含它们
#include "MyFunctions.pas"
无论如何,要回答您真正的问题,请使用 Exec
function。
要收集已执行命令的输出,请参阅 How to get an output of an Exec'ed program in Inno Setup?
我正在尝试使用 uses
语句来实现类似以下示例的内容:
uses Process;
...
var s : ansistring;
...
if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
writeln(s);
uses
语句导致编译时出错。
知道为什么吗?
Inno Setup/Pascal 脚本中没有 uses
语句。
您只能使用 functions listed in Inno Setup documentation。
要添加新功能,您有两种选择:
-
procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal); external 'MyDllFunc@files:MyDll.dll stdcall';
使用
从另一个文件中包含它们#include
preprocessor directive.#include "MyFunctions.pas"
无论如何,要回答您真正的问题,请使用 Exec
function。
要收集已执行命令的输出,请参阅 How to get an output of an Exec'ed program in Inno Setup?