-
Notifications
You must be signed in to change notification settings - Fork 8
/
example4.iss
90 lines (74 loc) · 2.8 KB
/
example4.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#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=example4
Compression=lzma
SolidCompression=true
CreateAppDir=true
ShowLanguageDialog=yes
[Languages]
Name: en; MessagesFile: compiler:Default.isl
Name: fr; MessagesFile: compiler:Languages\French.isl
Name: nl; MessagesFile: compiler:Languages\Dutch.isl
Name: ptbr; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
Name: es; MessagesFile: compiler:Languages\Spanish.isl
Name: gr; MessagesFile: compiler:Languages\Greek.isl
#define ITDRoot ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','InstallPath','')
#include ITDRoot+'\it_download.iss'
[Files]
Source: {#ITDRoot}\languages\*.ini.utf16; Flags: dontcopy
[Code]
{ EXAMPLE 4
In this example, a translation for the UI is read from a file. If the
language name from the [Languages] section matches the one in the filename
of an ITD language file, it is used. Otherwise, English is used.
}
{Load the ITD language file that corresponds to Inno's selected
language}
procedure LoadITDLang;
var
lang:string;
filename:string;
begin
lang:=ExpandConstant('{language}');
filename:='itd_'+lang+'.ini.utf16';
try
ExtractTemporaryFile(filename);
ITD_LoadStrings(expandconstant('{tmp}\'+filename));
except
{We get here if the selected language wasn't included in the
set of ITD translation files. In this case, we just use ITD's
built in translation file (English), by not loading anything.
Note that the exception will still appear while debugging -
you can turn this off in Inno Setup Compiler options
("Pause on exceptions"), or just ignore it. It doesn't appear
at runtime.}
end;
end;
procedure InitializeWizard();
begin
itd_init;
LoadITDLang;
//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.zip',expandconstant('{tmp}\petz4.zip'));
//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;