How to run a file before setup with Inno Setup

前端 未结 1 405
心在旅途
心在旅途 2020-12-08 15:57

Is it possible to run a file with Inno Setup, before the setup beginns? Documentation

相关标签:
1条回答
  • 2020-12-08 16:18

    Yes it is. In the [code] section run the file in the InitializeSetup() function. This example launches notepad before the setup runs.

    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;
    
    0 讨论(0)
提交回复
热议问题