2012-01-06 58 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

相關問題