开发者

Inno setup postinstall check box

开发者 https://www.devze.com 2023-03-14 11:28 出处:网络
Is there a way that check box is not shown to user or user cannot uncheck the checkbox? My purpose is I want to run a batch script at the end of installation and I must run it so I don\'t want this to

Is there a way that check box is not shown to user or user cannot uncheck the checkbox? My purpose is I want to run a batch script at the end of installation and I must run it so I don't want this to be users decisi开发者_Go百科on.


Declare this procedure in your [Code] section

procedure CurStepChanged(CurStep: TSetupStep);
var
  ResultCode: Integer;
begin
  if CurStep = ssDone then
  begin
    ShellExec('', ExpandConstant('YOUR APP PATH AND NAME OR IN YOUR CASE YOUR BATCH SCRIPT'), '', '', SW_SHOWNORMAL,
     ewNoWait, ResultCode);
  end;
end;


this will execute your batch after you press the "finish" button.


Just don't add the postinstall flag.

For instance,

[Run]
Filename: "{app}\myfile.bat"; Flags: shellexec
0

精彩评论

暂无评论...
验证码 换一张
取 消