Is it possible to accept custom command line parameters with Inno Setup

前端 未结 10 1155
梦谈多话
梦谈多话 2020-12-02 15:33

I am preparing an installer with Inno Setup. But I\'d like to add an additional custom (none of the available parameters) command line parameters and would like to get the v

10条回答
  •  借酒劲吻你
    2020-12-02 16:29

    Further to @DanLocks' answer, the {param:ParamName|DefaultValue} constant is documented near the bottom of the Constants page:

    http://www.jrsoftware.org/ishelp/index.php?topic=consts

    I found it quite handy for optionally suppressing the license page. Here is all I needed to add (using Inno Setup 5.5.6(a)):

    [code]
    { If there is a command-line parameter "skiplicense=true", don't display license page }
    function ShouldSkipPage(PageID: Integer): Boolean;
    begin
      Result := False
      if PageId = wpLicense then
        if ExpandConstant('{param:skiplicense|false}') = 'true' then
          Result := True;
    end;
    

提交回复
热议问题