Search code examples
inno-setupinno-download-plugin

Do not prevent installation if download fails with Inno Download Plugin


This is the code used to download any prerequisites during the installation,

#include <idp.iss>

[Code]
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
begin
  idpAddFileSize('<url>', ExpandConstant('{commonappdata}\<my file name>'), <my file size>);
  idpDownloadAfter(wpReady);
end;

However, if there is no internet connection it disables the Next button from continuing the installation. Here is the dialog,

enter image description here

The installation needs to continue even if any download fails. How to fix this?


Solution

  • IDP has AllowContinue option that allows continuing even on errors:

    procedure InitializeWizard();
    begin
      idpSetOption('AllowContinue', '1');
    end;
    

    Note that Inno Setup 6.1 has a native support for downloads. You may want to consider using it instead of IDP. See Inno Setup: Install file from Internet.


    Also, I believe that UpdateReadyMemo can be called multiple times (when the user returns from the "Ready" page). So your idpAddFileSize can also add the file to download queue multiple times.