我们可以让DwinHs Inno Setup下载插件更快地工作吗?

时间:2019-06-03 04:30:52

标签: inno-setup dwinshs

DwinHs具有一个DwinsHs_Data_Buffer_Length宏。我已将其设置为 8192 的值,但是下载速度仍然相当慢

例如,我有一个200 MBit的连接,文件是25 MB。下载需要两分半钟。

我在这里已经阅读了一些答案:

What is the best memory buffer size to allocate to download a file from Internet?

建议改用16K缓冲区。无论哪种方式,在给定用户系统的情况下,有什么方法可以在Pascal中使用最大缓冲区长度吗?

浏览器下载速度更快,为什么我们不能在Inno Setup中浏览?


示例

[ISPP]
#define HelpDocSetupURL "https://www.publictalksoftware.co.uk/downloads/PublicTalksHelpDocumentationSetup.exe"

[Setup]
AppID = TestID
AppName = Test App
OutputBaseFilename = My_Test_App_Setup
AppVersion = 1.0
DefaultDirName = {pf}\MyTestApp
DefaultGroupName = My Test App

[Tasks]
Name: "downloadhelp"; Description: "Task Desc"; GroupDescription: "Group Desc";

[Files]

Source: "{tmp}\HelpDocSetup.exe"; \
    DestDir: "{app}"; \
    Flags: external deleteafterinstall; \
    Tasks: downloadhelp; \
    Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), '{#HelpDocSetupURL}', 'My_Setup', 'Get', 0, 0 )

[Code]
program Setup;

#define DwinsHs_Use_Predefined_Downloading_WizardPage
#define DwinsHs_Data_Buffer_Length 8192
#include "dwinshs.iss"

procedure InitializeWizard();
begin
  DwinsHs_InitializeWizard(wpPreparing);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  DwinsHs_CurPageChanged(CurPageID, nil, nil);
end;

function ShouldSkipPage(CurPageId: Integer): Boolean;
begin
  Result := False;
  DwinsHs_ShouldSkipPage(CurPageId, Result);
end;

function BackButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  DwinsHs_BackButtonClick(CurPageID);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  DwinsHs_NextButtonClick(CurPageID, Result);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  DwinsHs_CancelButtonClick(CurPageID, Cancel, Confirm);
end;

1 个答案:

答案 0 :(得分:1)

软件作者就此问题回复我,并提出了以下建议:

  

您可以尝试将缓存大小设置为16384、32768或655536。

所以我将其设置为:

#define DwinsHs_Data_Buffer_Length 655536

结果好得多

Download Window

如您所见,只有 10秒


我不知道这样的缓存值对那些连接速度慢的人会有什么影响