gpt4 book ai didi

inno-setup - 使用 Inno Setup 静默运行安装,无需任何下一步按钮或安装按钮

转载 作者:行者123 更新时间:2023-12-03 23:19:09 26 4
gpt4 key购买 nike

我希望我的安装应该是静默的,没有用户单击任何下一步或安装按钮。我仍然试图禁用所有页面,我正在进入“准备安装”页面。我想避免这个安装页面。

最佳答案

要运行 Inno Setup 中内置的安装程序而无需与用户进行任何交互,甚至无需任何窗口,请使用 /SILENT or /VERYSILENT command-line parameters :

Instructs Setup to be silent or very silent. When Setup is silent the wizard and the background window are not displayed but the installation progress window is. When a setup is very silent this installation progress window is not displayed. Everything else is normal so for example error messages during installation are displayed and the startup prompt is (if you haven't disabled it with DisableStartupPrompt or the '/SP-' command line option explained above).



您也可以考虑使用 /SUPPRESSMSGBOXES范围。

如果您想让您的安装程序“静默”运行而无需任何额外的命令行开关,您可以:
  • 使用 ShouldSkipPage event function跳过大多数页面。
  • 使用计时器跳过“准备安装”页面(不能使用 ShouldSkipPage 跳过)。您可以使用 Inno Setup - How to close finished installer after a certain time? 中显示的技术

  • [Code]

    function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord;
    external 'SetTimer@User32.dll stdcall';
    function KillTimer(hWnd, nIDEvent: LongWord): LongWord;
    external 'KillTimer@User32.dll stdcall';

    var
    SubmitPageTimer: LongWord;

    procedure KillSubmitPageTimer;
    begin
    KillTimer(0, SubmitPageTimer);
    SubmitPageTimer := 0;
    end;

    procedure SubmitPageProc(H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
    begin
    WizardForm.NextButton.OnClick(WizardForm.NextButton);
    KillSubmitPageTimer;
    end;

    procedure CurPageChanged(CurPageID: Integer);
    begin
    if CurPageID = wpReady then
    begin
    SubmitPageTimer := SetTimer(0, 0, 100, CreateCallback(@SubmitPageProc));
    end
    else
    begin
    if SubmitPageTimer <> 0 then
    begin
    KillSubmitPageTimer;
    end;
    end;
    end;

    function ShouldSkipPage(PageID: Integer): Boolean;
    begin
    Result := True;
    end;

    对于 CreateCallback function , 你需要 Inno Setup 6。如果你坚持使用 Inno Setup 5,你可以使用 WrapCallback函数来自 InnoTools InnoCallback图书馆。

    另一种方法是发送 CN_COMMAND到下一步按钮,如下所示: How to skip all the wizard pages and go directly to the installation process?

    关于inno-setup - 使用 Inno Setup 静默运行安装,无需任何下一步按钮或安装按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42089779/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com