-
Notifications
You must be signed in to change notification settings - Fork 8
/
example6.iss
66 lines (53 loc) · 2.24 KB
/
example6.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.mycompany.com"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=example6
Compression=lzma
SolidCompression=true
CreateAppDir=true
ShowLanguageDialog=yes
[Languages]
Name: english; MessagesFile: compiler:Default.isl
#include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','');
[Code]
function MyAllowContinueEvent:integer;
begin
//Allow installation to continue only if the critical file downloaded successfully
if ITD_IsDownloadComplete(expandconstant('{tmp}\dogz5.zip')) then begin
result:=ITD_Silently_Continue;
{ The other possibility is ITD_Offer_Continue - ask the user if they want to continue or not}
end else
result:=ITD_No_Continue;
end;
procedure InitializeWizard();
begin
itd_init();
//Let's download two zipfiles from my website..
itd_addfile('http://www.sherlocksoftware.org/petz/files/dogz5.zip',expandconstant('{tmp}\dogz5.zip'));
itd_addfile('http://www.sherlocksoftware.org/petz/files/petz4.zap',expandconstant('{tmp}\petz4.zip'));
{One of these files is critical and the installation should not continue if
the file cannot be downloaded. The other is non-critical and the user should
have the option of continuing setup if the file did not download.
The second file here is non-critical, and in fact I've misspelled the URL so the download will fail.
We'll install a custom handler to decide if continuing is allowed}
itd_allowcontinueevent:=@MyAllowContinueEvent;
//Start the download after the "Ready to install" screen is shown
itd_downloadafter(wpReady);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then begin //Lets install those files that were downloaded for us
filecopy(expandconstant('{tmp}\dogz5.zip'),expandconstant('{app}\dogz5.zip'),false);
filecopy(expandconstant('{tmp}\petz4.zip'),expandconstant('{app}\petz4.zip'),false);
end;
end;