Inno Setup 6.2.1 web Download components problem

149 Views Asked by At

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

There are 0 best solutions below