Pergunta

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;
Foi útil?

Solução

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;

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top