1;--------------------------------
2;Include nsdialogs and 64bit checks
3
4!include "x64.nsh"
5!include LogicLib.nsh
6!include nsDialogs.nsh
7!include "eIDTranslations.nsh"
8!include WinMessages.nsh
9!include "eidmw_version.nsh"
10!include WinVer.nsh
11
12;!include nsDialogs_createTextMultiline.nsh
13;!include MUI2.nsh
14
15;--------------------------------
16;General
17
18  ;defines
19!define LOGFILE ""
20!define INSTALLER_NAME "certRegInstaller"
21
22  ;Name and file
23  Name "${INSTALLER_NAME} ${EIDMW_VERSION}"
24  OutFile "${INSTALLER_NAME} ${EIDMW_VERSION}.exe"
25  VIProductVersion "${EIDMW_VERSION}"
26  VIAddVersionKey "FileVersion" "${EIDMW_VERSION}"
27  ;NSIS complains that Fileversion was not set for English, though it should have been done by the line above
28VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${EIDMW_VERSION}"
29VIAddVersionKey "CompanyName" "Belgian Government"
30VIAddVersionKey "LegalCopyright" "Copyright (C) 2015"
31VIAddVersionKey "FileDescription" "Belgium eID MiddleWare"
32
33
34  ;Default installation folder
35  InstallDir "$PROGRAMFILES\Belgium Identity Card\CertReg"
36	;InstallDir "$LOCALAPPDATA\Belgium Identity Card"
37
38  ;Request application privileges for Windows Vista
39  RequestExecutionLevel admin
40	;admin;user
41	;TargetMinimalOS 5.0
42	;installer will run on Win2000 and newer
43
44  ;XPStyle on
45	WindowIcon on
46	Icon Setup.ico
47	caption "${INSTALLER_NAME} ${EIDMW_VERSION_SHORT}"
48	;SubCaption
49
50	Var Button
51	Var FileToCopy
52
53;--------------------------------
54	;Interface Settings
55	;SilentInstall silent
56BrandingText " "
57;"Fedict"
58InstallColors /windows
59;InstProgressFlags smooth
60
61;--------------------------------
62;Pages
63
64Page license
65Page instfiles "" show_instfiles ""
66
67;--------------------------------
68;Languages
69; its all in "eIDTranslations.nsh"
70;--------------------------------
71;Reserve Files
72
73
74;If you are using solid compression, files that are required before
75;the actual installation should be stored first in the data block,
76;because this will make your installer start faster.
77
78;!insertmacro MUI_RESERVEFILE_LANGDLL
79
80MiscButtonText $(ls_back) $(ls_next) $(ls_cancel) $(ls_close)
81; MessageBox MB_OK "A translated message: $(message)"
82LicenseLangString license ${LANG_ENGLISH} "..\..\doc\licenses\English\License_en.rtf"
83LicenseLangString license ${LANG_GERMAN} "..\..\doc\licenses\German\License_de.rtf"
84LicenseLangString license ${LANG_FRENCH} "..\..\doc\licenses\French\License_fr.rtf"
85LicenseLangString license ${LANG_DUTCH} "..\..\doc\licenses\Dutch\License_nl.rtf"
86
87LicenseData $(license)
88;LicenseText "text" "button_text"
89
90;--------------------------------
91;Installer Sections
92
93Section "Belgium Eid Certifiacte Registration Tool" BeidCertReg
94	SetOutPath "$INSTDIR"
95
96	ClearErrors
97	StrCpy $FileToCopy "$INSTDIR\CertReg\certreg.exe"
98	File "..\..\plugins_tools\certreg\Release\certreg.exe"
99	IfErrors 0 +2
100		Call ErrorHandler_file
101SectionEnd
102
103;--------------------------------
104;Error Messages
105Function ErrorHandler_file
106  MessageBox MB_ICONSTOP "$(ls_errorcopyfile) $FileToCopy"
107    Abort
108FunctionEnd
109
110
111;--------------------------------
112;Installer Functions
113
114Function .onInit
115;images used by this installer
116InitPluginsDir
117;extract the bitmaps to the temporary pluginsdir (which will be auto removed after installation)
118File /oname=$PLUGINSDIR\"welcome.bmp" "welcome.bmp"
119
120
121;for testing different languages
122	;Push ${LANG_GERMAN}
123	;Pop $LANGUAGE
124	;Language selection dialog
125
126;	Push ${LANG_ENGLISH}
127;	Push English
128;	Push ${LANG_DUTCH}
129;	Push Dutch
130;	Push ${LANG_FRENCH}
131;	Push French
132;	Push ${LANG_GERMAN}
133;	Push German
134
135;	Push A ; A means auto count languages
136	       ; for the auto count to work the first empty push (Push "") must remain
137;	LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
138
139;	Pop $LANGUAGE
140;	StrCmp $LANGUAGE "cancel" 0 +2
141;		Abort
142
143
144FunctionEnd
145
146Function .onInstSuccess
147FunctionEnd
148
149Function show_instfiles
150	GetDlgItem $Button $HWNDPARENT 1 ; next=1, cancel=2, back=3
151	SendMessage $Button ${WM_SETTEXT} 0 "STR:$(ls_next)"
152	GetDlgItem $Button $HWNDPARENT 2 ; next=1, cancel=2, back=3
153	SendMessage $Button ${WM_SETTEXT} 0 "STR:$(ls_cancel)"
154FunctionEnd
155