1

I wondering how send input from UserPage to idpAddFile to download it by Inno Download Plugin. After download I would like to use that zip and install app.

For now I have this:

var
  UserPage: TInputQueryWizardPage;

procedure InitializeWizard;
begin
  {Page for input Version}
  UserPage := CreateInputQueryPage(wpWelcome,
    'Number of Version', 'example : 1.8.20',
    'Program will download your input');
  UserPage.Add('Version:', False);
  UserPage.Values[0] := GetPreviousData('Version', '1.8.20');

  {Download file from input}
  idpAddFile(
    '127.0.0.1/repository/GU/my-apps/app.zip/{input}/ia-client.zip-{input}.zip',
    ExpandConstant('{tmp}\{input}.zip}'));
  idpDownloadAfter(wpReady);
end;

thanks for suggestion and help

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
John Doe
  • 147
  • 1
  • 1
  • 10

1 Answers1

0

Call the idpAddFile only just before the download starts, from NextButtonClick(wpReady), when you already know the version and the user has no chance to change it anymore:

function NextButtonClick(CurPageID: Integer): Boolean;
var
  Version: string;
  FileURL: string;
begin
  if CurPageID = wpReady then
  begin
    Version := UserPage.Values[0];
    FileURL := Format('http://www.example.com/path/%s/app-%0:s.zip', [Version]); 
    idpAddFile(FileURL, ExpandConstant(Format('{tmp}\app-%s.zip', [Version])));
  end;
  Result := True;
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Thanks Martin for answer, I paste your code above. But after click next nothing happens, ofc I change http address. Probably some Identifer bugs ? thanks for advice – John Doe Aug 03 '17 at 09:16
  • You have removed `idpDownloadAfter(wpReady);`. It must stay where it was. – Martin Prikryl Aug 03 '17 at 09:20
  • Thanks :) I Hope so last question :) How to idpAddFille send input ? In Code above I paste problem. – John Doe Aug 03 '17 at 10:01
  • My answer shows that! `%s` and `%0:s` in the URL are replaced with the user input - You can use the same technique for `'{tmp}\app.zip'` - edited. – Martin Prikryl Aug 03 '17 at 10:04