【问题标题】:Download and run sub install - Inno Download Plugin progress bar does not move during download下载并运行子安装 - Inno Download Plugin 进度条在下载过程中不移动
【发布时间】: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


【解决方案1】:

我确实得到了同样的行为。我不明白为什么。

但由于你只有一个文件,你可以用文件进度条代替总进度条:

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = IDPForm.Page.ID then
  begin
    IDPForm.TotalProgressBar.Visible := False;
    IDPForm.FileProgressBar.Top := IDPForm.TotalProgressBar.Top;
    IDPForm.FileProgressBar.Visible := True;
    IDPForm.DetailsButton.Visible := False;

    IDPForm.DetailsVisible := True;
  end;
end;

【讨论】:

  • 谢谢 - 我一定是在编辑时错过了您的回答。这将起作用。
  • 感谢您的帮助。我决定将 CurrentFileLabel.Caption 更改为 Downloading... 并显示所有详细信息。再次感谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-11
  • 1970-01-01
相关资源
最近更新 更多