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

And*_*rew 2 forms dll inno-setup silent-installer

我需要在屏幕上显示自己的表单后启动静默安装.

怎么做?

Heres是我的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;
Run Code Online (Sandbox Code Playgroud)

And*_*rew 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;
Run Code Online (Sandbox Code Playgroud)