Inno Download Plugin - how detect modal buttons?

65 views Asked by At

For our purposes, we decided to use Inno Download Plugin and Inno Setup version 6.2.0

We switched the installer to silent mode to get rid of unnecessary windows and buttons. It turned out somehow like this (I don’t attach idp.iss, it’s unchanged)

[code]https://pastebin.com/g7xb6iWj

Everything works fine, but there are a couple of but:

1 There is a Downloading window called by IDP, click on the cross to close the window and in the modal window that appears, confirm with Yes

Instead of aborting the download, it tries to proceed with the installation and creates shortcuts

2 There is a Downloading window called by IDP, turn off wifi, in the modal window that appears where they say "Internet is gone" and ask "Retry or Cancel?" click Cancel

Instead of aborting the download, it tries to proceed with the installation and creates shortcuts

I found an explanation here Exit from Inno Setup installation from [Code]

But I can't figure out exactly how to catch buttons in specific modal windows. And if I'm not mistaken, the second interrupt case is not native and only applies to IDP

Any ideas to right cancelation of installation of those 2 cases would be great.

1

There are 1 answers

0
Aleksandr Podaruev On

My friend did a solution

procedure CurPageChanged(CurPageID: Integer);
begin
  WizardForm.Bevel1.Visible := false;
  WizardForm.MainPanel.Visible := false;
  WizardForm.InnerNotebook.Top := 50;
  WizardForm.OuterNotebook.height := 400;

  if CurPageID = wpInstalling then begin
    Downloaded := idpFilesDownloaded();
    if not(Downloaded) then begin
      ExitProcess(553);
    end;
  end;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  if Cancel = True then begin
    ExitProcess(554);
  end;
end;