1

Ok, so I created the following iss but I the progress bar does not move. I want the setup file to download and run the other setup program. Everything works fine except the progress bar does not move.

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

Any Ideas? Everything else works fine.


Edit: I have a workaround that will show the details section. This might be more appropriate anyways. Still not sure why the Total progress is not updating.

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;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
user1819780
  • 105
  • 11
  • Which progress bar? *"Total progress"* or *"Current file*"? – Martin Prikryl May 31 '19 at 07:01
  • Not sure which one comes up by default in IDP. There is just one progress bar. The amount downloaded updates just not the progress bar. It is kind of strange since it updates when I run it inside Inno. It just does not update when I run the resultant exe. I will try it on a different computer and see what happens. Also, I cleaned up the code some so there are some minor edits above. – user1819780 May 31 '19 at 09:22
  • OK, so it's the *"Total progress"* - I assume that if you click on the *"Details"* button, then the *"Current file"* progress does updates, right? – Martin Prikryl May 31 '19 at 09:29
  • Yes the Current file updates - just not the Total progress – user1819780 May 31 '19 at 09:32

1 Answers1

1

I indeed get the same behavior. I do not understand why.

But as you have a single file, you can replace the total progress bar with file progress bar:

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;

enter image description here

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992