小编mcb*_*npc的帖子

输出重定向如何在Inno Setup中工作?

我在这里看到了这个问题:如何在Inno Setup中获得Exec'ed程序的输出?

但我不能让它自己工作,注释掉的代码是我尝试使这项工作,但我使用了一个bat文件,因为我无法使我的重定向工作.CacheInstanceName并且CacheInstanceDir是在别处定义的全局变量:

function CheckCacheExists(): Integer;
var
  args: String;
  buffer: String;
  ResultCode: Integer;
begin
  // args := 'qlist ' + CacheInstanceName + ExpandConstant(' nodisplay > {tmp}\appcheck.txt');
  // MsgBox(args, mbInformation, MB_OK);
  // Exec(CacheInstanceDir + '\bin\ccontrol.exe', 'qlist ' + CacheInstanceName + ExpandConstant(' nodisplay > "{tmp}\appcheck.txt"'), '', SW_SHOW,

  ExtractTemporaryFile('checkup.BAT');
  Exec(ExpandConstant('{tmp}\checkup.BAT'), CacheInstanceDir + ' ' + 
    CacheInstanceName + ' ' + ExpandConstant('{tmp}'), '', SW_SHOW,
    ewWaitUntilTerminated, ResultCode);
  LoadStringFromFile(ExpandConstant('{tmp}\appcheck.txt'),buffer);
  if Pos('^', buffer) = 0 then
  begin
    Result := 0
  end
  else …
Run Code Online (Sandbox Code Playgroud)

installation inno-setup

4
推荐指数
1
解决办法
3375
查看次数

标签 统计

inno-setup ×1

installation ×1