我们可以让 DwinHs Inno Setup 下载插件运行得更快吗?
Can we make the DwinHs Inno Setup download plugin work faster?
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;
软件作者就此问题回复我并提出:
You can try to set the cache size to 16384, 32768 or 655536.
所以我设置为:
#define DwinsHs_Data_Buffer_Length 655536
结果 好多了:
如您所见,只有 10 秒。
我不知道这样的缓存值对那些拥有较慢互联网的人有什么影响连接.
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;
软件作者就此问题回复我并提出:
You can try to set the cache size to 16384, 32768 or 655536.
所以我设置为:
#define DwinsHs_Data_Buffer_Length 655536
结果 好多了:
如您所见,只有 10 秒。
我不知道这样的缓存值对那些拥有较慢互联网的人有什么影响连接.