Download 如何使用innosetup从Microsoft自动下载文件

Download 如何使用innosetup从Microsoft自动下载文件,download,proxy,installation,inno-setup,inno-download-plugin,Download,Proxy,Installation,Inno Setup,Inno Download Plugin,我正在使用InnoSetup Tools Downloader插件。 它允许在安装过程中下载外部internet文件。 虽然它在许多情况下都可以工作,但在某些情况下,它是这样的: itd_addfile('http://download.microsoft.com/download/1/d/b/1dbee406-9b5f-48c5-b901-dd1a3f3c4669/Merlin.exe',expandconstant('{tmp}\Merlin.exe')); 它抱怨如下: 很抱歉,无法下载

我正在使用InnoSetup Tools Downloader插件。 它允许在安装过程中下载外部internet文件。 虽然它在许多情况下都可以工作,但在某些情况下,它是这样的:

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

很抱歉,无法下载这些文件。检查您的连接和 单击“重试”再次尝试下载文件,或单击 “取消”终止安装程序

我们可以使用webbrowser打开并下载:

http://download.microsoft.com/download/1/d/b/1dbee406-9b5f-48c5-b901-dd1a3f3c4669/Merlin.exe
为什么无法通过itdownload自动下载?
如何修复它

下面是导致问题的修改示例1

#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;

@TLama感谢您的评论-您能告诉我哪一个是报价吗,因为问题的质量很差,我可能会错过一些东西。[稍后还会删除我的评论]@徐志誠, 我下载这个文件和你发布的代码没有问题。我想到的第一件事是,由于插件(
InnoTools\u Downloader
)发送了一个非浏览器用户代理,MS服务器拒绝了下载,但即使这样似乎也没有问题(如果是,您可以设置用户代理)@徐志誠 代理是否妨碍了下载?您的浏览器可能配置为通过代理重定向http流量,但代码没有。TLama:谢谢您的建议。使用Firefox用户代理是个好主意。但是如果最终用户没有安装Firefox呢。在这种情况下,Firefox用户代理是否仍然有效?对不起,我不是任何类型的专家,我是一名小学教师,想为我的小型CAI程序编写一个安装程序。如果孩子们必须手动下载MS代理字符,他们将无法使用CAI。我不是一个IT专家。但是我非常想帮助我的学生。所以请原谅我愚蠢的问题,并请给我更多的细节。非常感谢。奇怪的是,如果itd_addfile指向像itd_addfile('('{tmp}\KUMI.acs'))这样的普通站点;itd_addfile将起作用。但不能在微软网站上工作。如果我的网络设置有问题,为什么其他站点可以工作而MS不能?