2

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

怎么做?

这是我的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;
4

2 回答 2

6

我为此创建了一个 hack:

[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;
于 2012-01-06T12:23:32.097 回答
0

一旦启动,就不可能使设置静默。唯一的方法是在命令行上传递/silentor参数。/verysilent

于 2012-01-06T11:45:15.577 回答