【问题标题】:Using the "uses" statement in Inno Setup Code section使用 Inno Setup Code 部分中的“uses”语句
【发布时间】:2016-10-16 02:22:26
【问题描述】:

我正在尝试使用uses 语句来实现类似于以下示例中的内容:

uses Process;
...
var s : ansistring;
...
if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
   writeln(s);

uses 语句在编译期间导致错误。 知道为什么吗?

【问题讨论】:

  • /bin/bash? Inno Setup 是 Windows 应用程序,而不是 *nix

标签: inno-setup pascalscript


【解决方案1】:

Inno 设置/Pascal 脚本中没有 uses 语句。


您只能使用functions listed in Inno Setup documentation

要添加新功能,您有两种选择:


无论如何,要回答您真正的问题,请使用Exec function

要收集执行命令的输出,请参阅How to get an output of an Exec'ed program in Inno Setup?

【讨论】:

  • 谢谢@Martin Prikryl。第一部分回答了我的问题。我实际上想要实现的是运行 tzutil 应用程序并使用返回的值(字符串或整数)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-05-06
  • 1970-01-01
  • 2021-08-24
  • 2021-02-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多