1

How to skip automatically a download if the url doesn't exists or there isn't internet connection...? Thanks in advance & cheers... ;-)

[Code]
procedure InitializeWizard();
begin
    idpAddFile('http://127.0.0.1/test1.zip', ExpandConstant('{tmp}\test1.zip'));
    idpDownloadAfter(wpReady);
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
alfreire
  • 99
  • 1
  • 7

2 Answers2

1

Referring the Inno download plugin documentation I think the best possible way is to try and check if the url/file exists and if it does then add it to the download list. According to the docs the idpGetFileSize gets the size of the file given in the url and returns true if it was able to calculate the file size without fail. Try this...

[Code]
procedure InitializeWizard();
var 
    size: Int64;
begin
    if idpGetFileSize('http://127.0.0.1/test1.zip', size) then
        idpAddFile('http://127.0.0.1/test1.zip', ExpandConstant('{tmp}\test1.zip'));
    idpDownloadAfter(wpReady);
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Sam
  • 128
  • 1
  • 5
-1

Looking in download plugin documentation I found this option that works too:

[Code]
procedure InitializeWizard();
begin
    idpSetOption('ErrorDialog',  'none');
    idpAddFile('http://127.0.0.1/test1.zip', ExpandConstant('{tmp}\test1.zip'));
    idpDownloadAfter(wpReady);
end;
alfreire
  • 99
  • 1
  • 7