我有这个定义:
#define HelpDocSetupFileSize FileSize("..HelpNDocCHMOutputMSAHelpDocumentationSetup.exe")
它通过查看我电脑上的数据文件而不是远程计算来获得文件大小。我在Inno Setup Download插件中使用了这个值来指定要下载的文件的大小。
我正在为新的Inno Setup下载功能重写代码。我管理这一切(精简(的代码是:
function NextButtonClick(CurPageID: integer): boolean;
begin
Result := True;
if (CurPageID = wpReady) then
begin
DownloadPage.Clear;
if (WizardIsTaskSelected('downloadhelp')) then
DownloadPage.Add('{#HelpDocSetupURL}', 'HelpDocSetup.exe', '');
DownloadPage.Show;
try
try
DownloadPage.Download;
Result := True;
except
SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
Result := False;
end;
finally
DownloadPage.Hide;
end;
end;
end;
我在Add
的测试版中找不到任何文档,从样本来看,第三个和第四个参数不用于提供文件大小。是第五个吗?
对Add
参数的一些官方澄清表示感谢。
TDownloadWizardPage.Add
只有三个参数。
您不需要(也不能(预先指定文件大小。Inno Setup从Content-Length
HTTP头中自行查找大小。