0

Having problems when Components section added to Inno Setup 6.2.1 download installation. Compiles ok, but unable to locate temporary file problem when code is run. What extra needs to be done when this download code is used for a components installer? Simplified to a single custom install option. Environment: Inno Setup 6.2.1, Windows 7

[Setup]
PrivilegesRequired=lowest

[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "test";  Description: "Test File";  Types: custom; Flags: exclusive

[Files]
Source: "{tmp}\version.txt";  DestDir: "{userappdata}\wire"; DestName: "test.txt"; Components: "test"; Flags: external ignoreversion
[Code]
var
DownloadPage: TDownloadWizardPage;

function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
  if Progress = ProgressMax then
    Log(Format('Successfully downloaded file to {tmp}: %s', [FileName]));
  Result := True;
end;

procedure InitializeWizard;
begin
  DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), @OnDownloadProgress);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = wpReady then begin
    DownloadPage.Clear
    DownloadPage.Add('http://wireshare.sourceforge.net/WSSecurityUpdates/version', 'version.txt', '');

    DownloadPage.Show;
  try
    try
    DownloadPage.Download; // This downloads the files to {tmp}
    Result := True;
    except
    if DownloadPage.AbortedByUser then
      Log('Aborted by user.')
    else
      SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
    Result := False;
  end;
finally
  DownloadPage.Hide;
end;
end else
Result := True;
end;
StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Jenn
  • 111
  • 7
  • I have been unable to find examples of component installers with the newer Inno Setup 6 download tool. Is there something basic I am missing? I do not pretend to be a pascal coder, I am not. This question also went unanswered on Inno's mail-forum, which as I guessed is more of a bug or beta forum. – Jenn Mar 01 '23 at 03:10
  • Can someone please point out where the error lies? I am guessing the error is basic, but using my existing component installers with the new built-in download function fail. No code required, if possible simply explain what the error is. – Jenn Mar 06 '23 at 07:39

0 Answers0