2012-01-06 28 views
2

我需要在屏幕上显示我自己的表单后开始静默安装。InnoSetup:如何从dll显示我自己的表单后启动静默安装?

如何做到这一点?

继承人是我的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; 

回答

6

我创建了这个黑客:

[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; 
+0

谢谢!我无法找到让我的设置在执行诸如驱动程序安装或更新等操作之后自动执行的方法......但现在我确实......不知道为什么我没有想到这一点。 – Thomas 2012-04-28 03:34:42

+0

什么是'WizardForm'? – 2013-10-10 08:43:19

0

一旦开始安装,就无法使安静。 唯一的方法是在命令行上通过参数/silent/verysilent

+0

没有黑客这样做呢? – Andrew 2012-01-06 11:48:08

相关问题