source: opsi/products/bacula/CLIENT_DATA/setup3264.ins@ 1023

Last change on this file since 1023 was 1023, checked in by joergs, on Jul 4, 2012 at 6:53:50 PM

bugfixes, uninstall, properties, bacula-fd.conf

File size: 9.5 KB
RevLine 
[1022]1; Copyright (c) uib gmbh (www.uib.de)
2; This sourcecode is owned by uib
3; and published under the Terms of the General Public License.
4; credits: http://www.opsi.org/en/credits/
5
6[Actions]
7requiredWinstVersion >= "4.10.8.6"
8
9DefVar $MsiId32$
10DefVar $UninstallProgram32$
11DefVar $MsiId64$
12DefVar $UninstallProgram64$
13DefVar $LogDir$
14DefVar $ProductId$
15DefVar $ProductVer$
16DefVar $MinimumSpace$
[1023]17DefVar $InstallDir$
[1022]18DefVar $InstallDir32$
19DefVar $InstallDir64$
20DefVar $ExitCode$
21DefVar $LicenseRequired$
22DefVar $LicenseKey$
23DefVar $LicensePool$
24DefVar $INST_SystemType$
25DefVar $INST_architecture$
26
[1023]27DefVar $filedaemon_name$
28DefVar $filedaemon_full_name$
29DefVar $filedaemon_full_password$
30DefVar $filedaemon_monitor_name$
31DefVar $filedaemon_monitor_password$
32DefVar $director_name$
33DefVar $director_address$
34DefVar $director_password$
35
36
[1022]37Set $INST_SystemType$ = GetSystemType
38set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
39
[1023]40set $filedaemon_name$ = GetProductProperty( "filedaemon_name", "" )
41set $filedaemon_full_password$ = GetProductProperty( "filedaemon_full_password", "filedaemon_full_password" )
42set $filedaemon_monitor_password$ = GetProductProperty( "filedaemon_monitor_password", "filedaemon_monitor_password" )
43set $director_name$ = GetProductProperty( "director_name", "director_name" )
44set $director_address$ = GetProductProperty( "director_address", "director_address.example.com" )
45set $director_password$ = GetProductProperty( "director_password", "director_password" )
[1022]46
47Set $LogDir$ = "%SystemDrive%\tmp"
48
49; ----------------------------------------------------------------
50; - Please edit the following values -
51; ----------------------------------------------------------------
52;$ProductId$ should be the name of the product in opsi
53; therefore please: only lower letters, no umlauts,
54; no white space use '-' as a seperator
55Set $ProductId$ = "bacula"
56Set $ProductVer$ = "5.2.10"
[1023]57Set $MinimumSpace$ = "30 MB"
[1022]58; the path were we find the product after the installation
[1023]59Set $InstallDir$ = "%ProgramFilesDir%\Bacula"
60Set $InstallDir32$ = "%ProgramFiles32Dir%\Bacula"
61Set $InstallDir64$ = "%ProgramFiles64Dir%\Bacula"
[1022]62Set $LicenseRequired$ = "false"
63Set $LicensePool$ = "p_" + $ProductId$
64; ----------------------------------------------------------------
65
66if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
67 LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
68 isFatalError
69 ; Stop process and set installation status to failed
[1023]70endif
71
72comment "Show product picture"
73ShowBitmap "%ScriptPath%\logo.png" $ProductId$
74
75if FileExists("%ScriptPath%\delsub3264.ins")
76 comment "Start uninstall sub section"
77 Sub "%ScriptPath%\delsub3264.ins"
78endif
79
80;if $LicenseRequired$ = "true"
81; comment "Licensing required, reserve license and get license key"
82; Sub_get_licensekey
83;endif
84
85comment "installing"
86
87if $filedaemon_name$ = ""
88 set $filedaemon_full_name$ = "%PCname%-fd"
89 set $filedaemon_monitor_name$ = "%PCname%-mon"
[1022]90else
[1023]91 set $filedaemon_full_name$ = "$filedaemon_name$-fd"
92 set $filedaemon_monitor_name$ = "$filedaemon_name$-mon"
93endif
[1022]94
95
[1023]96if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
97 Message "Installing " + $ProductId$ + " 32 Bit..."
98 comment "Start setup program"
99 Winbatch_install_32
100 Sub_check_exitcode
101 ;comment "Copy files"
102 ;Files_install_32 /32Bit
103 ;comment "Patch Registry"
104 ;Registry_install /32Bit
105 ;comment "Create shortcuts"
106 ;LinkFolder_install
[1022]107endif
108
[1023]109if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
110 Message "Installing " + $ProductId$ + " 64 Bit..."
111 comment "Start setup program"
112 Winbatch_install_64
113 Sub_check_exitcode
114 ;comment "Copy files"
115 ;Files_install_64 /64Bit
116 ;comment "Patch Registry"
117 ;Registry_install /64Bit
118 ;comment "Create shortcuts"
119 ;LinkFolder_install
120endif
121
122;Patches_bacula_conf $InstallDir$+"\bacula-fd.conf"
123DosBatch_bacula-fd.conf
124
[1022]125;
[1023]126; end
[1022]127;
128
129
130
[1023]131; winbatch installer:
132; /S silent installl
133; /D destination path
134; use this, otherwise it installs to "program files" for all languages.
135; don't use " around argument, otherwise argument is ignored
[1022]136
[1023]137[Winbatch_install_32]
138"%ScriptPath%\data\bacula-win32-$ProductVer$.exe" /S /D=$InstallDir32$
[1022]139
140[Winbatch_install_64]
[1023]141"%ScriptPath%\data\bacula-win64-$ProductVer$.exe" /S /D=$InstallDir64$
[1022]142
[1023]143[DosBatch_bacula-fd.conf]
144(
145echo # managed by opsi
146echo #
147echo # "Global" File daemon configuration specifications
148echo #
149echo FileDaemon { # this is me
150echo Name = $filedaemon_full_name$
151echo FDport = 9102 # where we listen for the director
152echo WorkingDirectory = "$InstallDir32$\\working"
153echo Pid Directory = "$InstallDir32$\\working"
154echo Plugin Directory = "$InstallDir32$\\plugins"
155echo Maximum Concurrent Jobs = 10
156echo }
157;echo
158echo #
159echo # List Directors who are permitted to contact this File daemon
160echo #
161echo Director {
162echo Name = $director_name$
163echo Password = "$filedaemon_full_password$"
164echo }
165;echo
166echo #
167echo # Restricted Director, used by tray-monitor to get the
168echo # status of the file daemon
169echo #
170echo Director {
171echo Name = $filedaemon_monitor_name$
172echo Password = "$filedaemon_monitor_password$"
173echo Monitor = yes
174echo }
175;echo
176echo # Send all messages except skipped files back to Director
177echo Messages {
178echo Name = Standard
179echo director = $director_name$ = all, !skipped, !restored
180echo }
181) >> $InstallDir$/bacula-fd.conf
[1022]182
183
184
[1023]185[Files_install_32]
186; Example of recursively copying some files into the installation directory:
187;
188; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
189
[1022]190[Files_install_64]
191; Example of recursively copying some files into the installation directory:
192;
193; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
194
195[Registry_install]
196; Example of setting some values of an registry key:
197;
198; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
199; set "name1" = "some string value"
200; set "name2" = REG_DWORD:0001
201; set "name3" = REG_BINARY:00 af 99 cd
202
203[LinkFolder_install]
204; Example of deleting a folder from AllUsers startmenu:
205;
206; set_basefolder common_programs
207; delete_subfolder $ProductId$
208;
209; Example of creating an shortcut to the installed exe in AllUsers startmenu:
210;
211; set_basefolder common_programs
212; set_subfolder $ProductId$
213;
214; set_link
215; name: $ProductId$
216; target: <path to the program>
217; parameters:
218; working_dir: $InstallDir$
219; icon_file:
220; icon_index:
221; end_link
222;
223; Example of creating an shortcut to the installed exe on AllUsers desktop:
224;
225; set_basefolder common_desktopdirectory
226; set_subfolder ""
227;
228; set_link
229; name: $ProductId$
230; target: <path to the program>
231; parameters: <some_param>
232; working_dir: $InstallDir$
233; icon_file: <path to icon file>
234; icon_index: 2
235; end_link
236
237[Sub_get_licensekey]
238comment "License management is enabled and will be used"
239
240comment "Trying to get a license key"
241Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
242; If there is an assignment of exactly one licensepool to the product the following call is possible:
243; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
244;
245; If there is an assignment of a license pool to a windows software id, it is possible to use:
246; DefVar $WindowsSoftwareId$
247; $WindowsSoftwareId$ = "..."
248; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
249
250DefVar $ServiceErrorClass$
251set $ServiceErrorClass$ = getLastServiceErrorClass
252comment "Error class: " + $ServiceErrorClass$
253
254if $ServiceErrorClass$ = "None"
255 comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
256else
257 if $ServiceErrorClass$ = "LicenseConfigurationError"
258 LogError "Fatal: license configuration must be corrected"
259 LogError getLastServiceErrorMessage
260 isFatalError
261 else
262 if $ServiceErrorClass$ = "LicenseMissingError"
263 LogError "Fatal: required license is not supplied"
264 isFatalError
265 endif
266 endif
267endif
268
269[Sub_check_exitcode]
270comment "Test for installation success via exit code"
271set $ExitCode$ = getLastExitCode
272; informations to exit codes see
273; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
274; http://msdn.microsoft.com/en-us/library/aa368542.aspx
275if ($ExitCode$ = "0")
276 comment "Looks good: setup program gives exitcode zero"
277else
278 comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
279 if ($ExitCode$ = "1605")
280 comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
281 comment "Uninstall of a not installed product failed - no problem"
282 else
283 if ($ExitCode$ = "1641")
284 comment "looks good: setup program gives exitcode 1641"
285 comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
286 else
287 if ($ExitCode$ = "3010")
288 comment "looks good: setup program gives exitcode 3010"
289 comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
290 else
291 logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
292 isFatalError
293 endif
294 endif
295 endif
296endif
297
Note: See TracBrowser for help on using the repository browser.