代码之家  ›  专栏  ›  技术社区  ›  Stephan Schielke PiX

如何在使用Inno安装程序进行安装之前运行文件

  •  19
  • Stephan Schielke PiX  · 技术社区  · 14 年前

    在安装开始之前,是否可以用Inno安装程序运行文件? Documentation

    1 回复  |  直到 11 年前
        1
  •  25
  •   mghie    11 年前

    是的。在 [code] InitializeSetup() 功能。此示例在运行安装程序之前启动记事本。

    function InitializeSetup(): boolean;
    var
      ResultCode: integer;
    begin
    
      // Launch Notepad and wait for it to terminate
      if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
         ewWaitUntilTerminated, ResultCode) then
      begin
        // handle success if necessary; ResultCode contains the exit code
      end
      else begin
        // handle failure if necessary; ResultCode contains the error code
      end;
    
      // Proceed Setup
      Result := True;
    
    end;
    
    推荐文章