【发布时间】:2019-05-30 22:35:26
【问题描述】:
好的,所以我创建了以下问题,但进度条没有移动。我希望安装文件下载并运行其他安装程序。一切正常,只是进度条不动。
#define MyAppName "My Program Setup Downloader"
#define MySetupAppName "My Program Setup.exe"
#define MySetupUrlFolder "https://www.example.com/folder/"
#pragma include __INCLUDE__ + ";" + "c:\Program Files (x86)\Inno Download Plugin\"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
DisableReadyPage=yes
DisableFinishedPage=yes
CreateAppDir=no
Uninstallable=no
#include <idp.iss>
[Code]
var FileName: string;
procedure InitializeWizard;
var DownloadUrl: String;
begin
FileName := ExpandConstant('{tmp}\{#MySetupAppName}');
DownloadUrl := '{#MySetupUrlFolder}{#MySetupAppName}';
idpAddFile(DownloadUrl, FileName);
idpDownloadAfter(wpSelectDir);
end;
function NextButtonClick(CurPageID: Integer) : boolean;
var ResultCode: Integer;
begin
if CurPageID = IDPForm.Page.ID then
begin
Result := Exec(FileName, '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
if not Result then MsgBox('Error Running Downloaded Setup File', mbError, MB_OK);
Result := True;
end
else Result := True;
end;
有什么想法吗?其他一切正常。
编辑:我有一个解决方法,可以显示详细信息部分。无论如何,这可能更合适。仍然不确定为什么总进度没有更新。
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = IDPForm.Page.ID then
begin
idpShowDetails(True);
IDPForm.TotalProgressBar.Visible := false;
IDPForm.TotalProgressLabel.Visible := false;
IDPForm.TotalDownloaded.Visible := false;
IDPForm.CurrentFileLabel.Caption := 'Downloading...';
IDPForm.DetailsButton.Visible := False;
WizardForm.NextButton.Visible := False;
WizardForm.PageNameLabel.Caption := 'Downloading Setup File';
WizardForm.PageDescriptionLabel.Caption := 'Please wait while the Setup file is being downloaded.';
end;
end;
【问题讨论】:
-
哪个进度条? “总进度”或“当前文件”?
-
不确定 IDP 中默认出现哪一个。只有一个进度条。下载量更新只是不是进度条。这有点奇怪,因为当我在 Inno 中运行它时它会更新。当我运行生成的 exe 时,它只是不会更新。我将在另一台计算机上尝试它,看看会发生什么。另外,我清理了一些代码,所以上面有一些小的修改。
-
好的,所以它是 "Total progress" - 我假设如果你点击 "Details" 按钮,那么 “当前文件”进度会更新,对吧?
-
是的,当前文件更新 - 只是不是总进度
标签: windows installation inno-setup pascalscript inno-download-plugin