InnoSetup:如何在从 dll 显示我自己的表单后开始静默安装?

发布于 2024-12-25 15:33:47 字数 604 浏览 1 评论 0原文

在屏幕上显示我自己的表单后,我需要开始静默安装。

怎么做呢?

这是我的 ISS 代码,OpenWizardForm 过程是从我自己的 DLL 导入的。它将打开模式表单,接受用户数据,关闭模式表单,然后继续执行。

[Setup]
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
DisableStartupPrompt=yes
DisableFinishedPage=yes

[Code]

procedure InitializeWizard();
begin
  WizardForm.BorderStyle := bsNone;
  WizardForm.Width := 0;
  WizardForm.Height := 0;
  OpenWizardForm(WizardForm.Handle); // here is my own modal form will appear
  // and now the silent installation must be started
end;

I need to start the silent installation after showing my own form on the screen.

How to do that?

Heres is my ISS code, an OpenWizardForm procedure is imported from my own DLL. It will open the modal form, accept the user's data, close the modal form and then continue execution.

[Setup]
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
DisableStartupPrompt=yes
DisableFinishedPage=yes

[Code]

procedure InitializeWizard();
begin
  WizardForm.BorderStyle := bsNone;
  WizardForm.Width := 0;
  WizardForm.Height := 0;
  OpenWizardForm(WizardForm.Handle); // here is my own modal form will appear
  // and now the silent installation must be started
end;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风尘浪孓 2025-01-01 15:33:47

我为此创建了一个黑客:

[Setup]
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
DisableStartupPrompt=yes
DisableFinishedPage=yes


[Code]   

const
  WM_CLOSE = $0010;
  WM_KEYDOWN = $0100;
  WM_KEYUP = $0101;
  VK_RETURN = 13;

procedure InitializeWizard();
begin
  WizardForm.BorderStyle := bsNone;
  WizardForm.Width := 0;
  WizardForm.Height := 0;
  OpenWizardForm(WizardForm.Handle);

  // Pressing the default "Install" button to continue the silent install
  PostMessage(WizardForm.Handle, WM_KEYDOWN, VK_RETURN, 0);
  PostMessage(WizardForm.Handle, WM_KEYUP, VK_RETURN, 0);

  // Or can exit the wizard if the user has cancelled installation
  // PostMessage(WizardForm.Handle, WM_CLOSE, 0, 0);
end;

I created a hack for this:

[Setup]
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
DisableStartupPrompt=yes
DisableFinishedPage=yes


[Code]   

const
  WM_CLOSE = $0010;
  WM_KEYDOWN = $0100;
  WM_KEYUP = $0101;
  VK_RETURN = 13;

procedure InitializeWizard();
begin
  WizardForm.BorderStyle := bsNone;
  WizardForm.Width := 0;
  WizardForm.Height := 0;
  OpenWizardForm(WizardForm.Handle);

  // Pressing the default "Install" button to continue the silent install
  PostMessage(WizardForm.Handle, WM_KEYDOWN, VK_RETURN, 0);
  PostMessage(WizardForm.Handle, WM_KEYUP, VK_RETURN, 0);

  // Or can exit the wizard if the user has cancelled installation
  // PostMessage(WizardForm.Handle, WM_CLOSE, 0, 0);
end;
救赎№ 2025-01-01 15:33:47

安装程序一旦开始就无法保持静默。
唯一的方法是在命令行上传递 /silent/verysilent 参数。

It is not possible to make the setup silent once it's started.
The only way is to pass the /silent or /verysilent parameter on the command line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文