Download during installation by Inno Setup

5

Working in a company that uses Inno Setup to create the installers for your products, I was recently tasked with creating a better installer, one of the improvements that was suggested would be to download a plug-in during the installation process. I'm not very familiar with this procedure.

I would like to know how I enter this information in the file that I have the codes of my installer.

    
asked by anonymous 23.11.2016 / 18:59

2 answers

2

You can use the Inno Download Plugin plugin.

Example usage:

#include <idp.iss>

[Files]
Source: "{tmp}\file1.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576
Source: "{tmp}\file2.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576
Source: "{tmp}\file3.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576

[Icons]
Name: "{group}\{cm:UninstallProgram,My Program}"; Filename: "{uninstallexe}"

[Code]
procedure InitializeWizard();
begin
    idpAddFileSize('http://127.0.0.1/file1.xyz', ExpandConstant('{tmp}\file1.xyz'), 1048576);
    idpAddFileSize('http://127.0.0.1/file2.xyz', ExpandConstant('{tmp}\file2.xyz'), 1048576);
    idpAddFileSize('http://127.0.0.1/file3.xyz', ExpandConstant('{tmp}\file3.xyz'), 1048576);

    idpDownloadAfter(wpReady);
end.

Or

The InnoTools Downloader plugin , for use, see Documentation

    
23.11.2016 / 19:15
2

Good afternoon,

I was able to do the following, in [TASK], I added an option for the client to decide whether to download it or not, after informing my database I added in [CODE] the following condition.

function NextButtonClick(CurPageID: Integer): Boolean;
begin  
Result := True;
if CurPageID = wpSelectTasks then
begin
if WizardForm.TasksList.Checked[1] then
if MsgBox('O download pode demorar dependendo da velocidade da sua internet, deseja continuar ?', mbConfirmation, MB_YESNO) = IDYES then 
begin 
idpAddFile('http://www.site.com.br/download/teste.exe', ExpandConstant('{tmp}\teste.exe'));
idpDownloadAfter(wpReady);

end else
begin
if CurPageID = wpSelectTasks then
WizardForm.TasksList.Checked[1] := False;
end;
end;
end;
    
20.12.2016 / 19:40