How can I use innosetup to automatically download files from Microsoft

I am using the UseroSetup Tools Downloader plugin here . It allows you to download external internet files during installation. While it may work in many cases, in some cases:

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

      

He complains about the following:

Sorry, files cannot be downloaded. Check the connection and click Retry to upload the files again or click Cancel to complete the setup.

We can use a web browser to open and download:

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

      

Why can't it be automatically downloaded by itdownload?
How to fix it?

Below is a modified example1 that 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 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;

      

+3
installation proxy download inno-setup inno-download-plugin


source to share


No one has answered this question yet

Check out similar questions:

964
Download file from Android and show progress in ProgressDialog
931
Download one folder or directory from the GitHub repository
484
wget to download the file and save as a different filename
406
How to download and save a file from the Internet using Java?
383
How to trigger file download on HTML or JavaScript button click
369
Load jQuery.Ajax file
333
Loading file from spring controllers
318
Upload file to server from url
4
VCL Styles for Inno Setup has problems rendering some elements of the loader page
1
Inno Setup Attempts to create a new DirectX installation template file for InnoSetup modular dependency installer



All Articles
Loading...
X
Show
Funny
Dev
Pics