Download during installation by Inno Setup

Asked

Viewed 681 times

5

I work with a company that uses Inno Setup to create the installers of its products, recently I was tasked with creating a better installer, one of the improvements that were suggested would be to download an add-on during the installation process. I’m not very familiar with this procedure.

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

2 answers

3


You can use the plugin Inno Download Plugin.

Example of use:

#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 Plugin Innotools Downloader, for use, see Documentation

  • David good afternoon, as I’m sure these plugins are installed on my machine performed the download of Inno Download Plugin but even after the installation I see no change in the software.

2

Good afternoon,

I was able to perform as follows, in [TASK], I added an option for the client to decide whether to download 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;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.