下载和 运行 子安装 - Inno Download Plugin 进度条在下载过程中不会移动

Download and run sub install - Inno Download Plugin progress bar does not move during download

好的,所以我创建了以下iss,但是我的进度条没有移动。我想要下载安装文件和 运行 其他安装程序。除了进度条不动外一切正常。

#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;

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

但是因为你只有一个文件,你可以用文件进度条代替总进度条:

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;