3

I am using InnoSetup Tools Downloader plugin from here. It enables downloading external internet files during installation. While it can work in many cases, but in some case like this:

itd_addfile('http://download.microsoft.com/download/1/d/b/1dbee406-9b5f-48c5-b901-dd1a3f3c4669/Merlin.exe',expandconstant('{tmp}\Merlin.exe'));

It complains with the following:

Sorry, the files could not be downloaded. Check your connection and click ''Retry'' to try downloading the files again, or click ''Cancel'' to terminate setup.

WE can use webbrowser to open and download:

http://download.microsoft.com/download/1/d/b/1dbee406-9b5f-48c5-b901-dd1a3f3c4669/Merlin.exe

Why it cannot be automatically downloaded by itdownload?
How to fix it?

Below is the modified example1 which caused the problem.

#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.mycompany.com"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=example1
Compression=lzma
SolidCompression=true
CreateAppDir=true
ShowLanguageDialog=yes

[Languages]
Name: english; MessagesFile: compiler:Default.isl

#include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','');

[Code]
procedure InitializeWizard();
begin
 itd_init;

 //Let's download two zipfiles from MS Agent  website..
 itd_addfile('http://download.microsoft.com/download/1/d/b/1dbee406-9b5f-48c5-b901-dd1a3f3c4669/Merlin.exe',expandconstant('{tmp}\Merlin.exe'));

 //Start the download after the "Ready to install" screen is shown
 itd_downloadafter(wpReady);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
 if CurStep=ssInstall then begin //Lets install those files that were downloaded for us
  filecopy(expandconstant('{tmp}\Merlin.exe'),expandconstant('{app}\Merlin.exe'),false);
 end;
end;
Cœur
  • 37,241
  • 25
  • 195
  • 267
徐志誠
  • 31
  • 2
  • 1
    @TLama Thanks for comments - can u tell me which one is quote, because the question was with poor quality and I could miss something.[will also remove my comment later] – ekostadinov Sep 26 '14 at 07:24
  • 2
    @徐志誠, I've had no problem downloading that file with the code you've posted. The first thing that came to my mind was that the MS server rejects that download due to a non browser user agent sent by that plugin (`InnoTools_Downloader`), but even that doesn't seem to be the problem (if it were, you could set the user agent [`this way`](http://pastebin.com/ZJzSx9Pj)). – TLama Sep 26 '14 at 09:15
  • @徐志誠 Is a proxy getting in the way of the download? It's possible your browser is configured to redirect http traffic through a proxy but the code does not. – ComputerDruid Sep 26 '14 at 16:59
  • TLama: Thank you for the suggestion. Using Firefox user agent is a good idea. But what if the end user doesn't have Firefox installed. In that case, will Firefox user agent still work, or ...not? Sorry, I am not an expert of any kind, I am an elementary teacher who wants to write an installer of my small CAI program. Children will mot be able to use the CAI if they have to manually download MS Agent characters. And I am not an IT expert. But I want to help my students very much. So forgive my stupid question and please give me more details. Thank you! – 徐志誠 Sep 27 '14 at 03:50
  • The strange thing is that if the itd_addfile points to normal sites like itd_addfile('http://www.erpsoftwares.com/MSAgents/downloads/KUMI.acs',expandconstant('{tmp}\KUMI.acs')); the itd_addfile will work. But not work on stuff on MS site. If there is a problem on my network setting, why other sites work while MS doesn't? – 徐志誠 Sep 27 '14 at 03:59
  • p.s. My XP's IE browser version is 6, due to some unknown reason, can not be updated. I normally use Firefox to view pages. Does the issue has something to do with the version of IE? – 徐志誠 Sep 27 '14 at 04:03
  • Did anyone ever solve this? I'm having the same problem. I even tried with my firewall disabled and with a file on my own webserver. – bgmCoder Nov 10 '14 at 21:43

0 Answers0