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

Last change on this file since 1030 was 1029, checked in by joergs, on Jul 10, 2012 at 7:00:00 PM

5.2.10-3: write properties filedaemon_full_name and filedaemon_monitor_name back to opsi server, added properties fileset and jobdefs

File size: 10.1 KB
Line 
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$
17DefVar $InstallDir$
18DefVar $InstallDir32$
19DefVar $InstallDir64$
20DefVar $ExitCode$
21DefVar $LicenseRequired$
22DefVar $LicenseKey$
23DefVar $LicensePool$
24DefVar $INST_SystemType$
25DefVar $INST_architecture$
26
27DefVar $filedaemon_full_name$
28DefVar $filedaemon_full_password$
29DefVar $filedaemon_monitor_name$
30DefVar $filedaemon_monitor_password$
31DefVar $director_name$
32DefVar $director_address$
33DefVar $director_password$
34
35
36Set $INST_SystemType$ = GetSystemType
37set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
38
39set $filedaemon_full_name$ = GetProductProperty( "filedaemon_full_name", "" )
40set $filedaemon_full_password$ = GetProductProperty( "filedaemon_full_password", "filedaemon_full_password" )
41set $filedaemon_monitor_name$ = GetProductProperty( "filedaemon_monitor_name", "" )
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" )
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"
57Set $MinimumSpace$ = "30 MB"
58; the path were we find the product after the installation
59Set $InstallDir$ = "%ProgramFilesDir%\Bacula"
60Set $InstallDir32$ = "%ProgramFiles32Dir%\Bacula"
61Set $InstallDir64$ = "%ProgramFiles64Dir%\Bacula"
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
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_full_name$ = ""
88 set $filedaemon_full_name$ = "%HostID%-fd"
89 opsiservicecall_set_product_property_filedaemon_full_name
90endif
91
92if $filedaemon_monitor_name$ = ""
93 set $filedaemon_monitor_name$ = "%HostID%-mon"
94 opsiservicecall_set_product_property_filedaemon_monitor_name
95endif
96
97
98if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
99 Message "Installing " + $ProductId$ + " 32 Bit..."
100 comment "Start setup program"
101 Winbatch_install_32
102 Sub_check_exitcode
103 ;comment "Copy files"
104 ;Files_install_32 /32Bit
105 ;comment "Patch Registry"
106 ;Registry_install /32Bit
107 ;comment "Create shortcuts"
108 ;LinkFolder_install
109endif
110
111if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
112 Message "Installing " + $ProductId$ + " 64 Bit..."
113 comment "Start setup program"
114 Winbatch_install_64
115 Sub_check_exitcode
116 ;comment "Copy files"
117 ;Files_install_64 /64Bit
118 ;comment "Patch Registry"
119 ;Registry_install /64Bit
120 ;comment "Create shortcuts"
121 ;LinkFolder_install
122endif
123
124;Patches_bacula_conf $InstallDir$+"\bacula-fd.conf"
125DosBatch_bacula-fd.conf
126
127;
128; end
129;
130
131
132
133; winbatch installer:
134; /S silent installl
135; /D destination path
136; use this, otherwise it installs to "program files" for all languages.
137; don't use " around argument, otherwise argument is ignored
138
139[Winbatch_install_32]
140"%ScriptPath%\data\bacula-win32-$ProductVer$.exe" /S /D=$InstallDir32$
141
142[Winbatch_install_64]
143"%ScriptPath%\data\bacula-win64-$ProductVer$.exe" /S /D=$InstallDir64$
144
145[DosBatch_bacula-fd.conf]
146(
147echo # managed by opsi
148echo #
149echo # "Global" File daemon configuration specifications
150echo #
151echo FileDaemon { # this is me
152echo Name = $filedaemon_full_name$
153echo FDport = 9102 # where we listen for the director
154echo WorkingDirectory = "$InstallDir32$\\working"
155echo Pid Directory = "$InstallDir32$\\working"
156echo Plugin Directory = "$InstallDir32$\\plugins"
157echo Maximum Concurrent Jobs = 10
158echo }
159;echo
160echo #
161echo # List Directors who are permitted to contact this File daemon
162echo #
163echo Director {
164echo Name = $director_name$
165echo Password = "$filedaemon_full_password$"
166echo }
167;echo
168echo #
169echo # Restricted Director, used by tray-monitor to get the
170echo # status of the file daemon
171echo #
172echo Director {
173echo Name = $filedaemon_monitor_name$
174echo Password = "$filedaemon_monitor_password$"
175echo Monitor = yes
176echo }
177;echo
178echo # Send all messages except skipped files back to Director
179echo Messages {
180echo Name = Standard
181echo director = $director_name$ = all, !skipped, !restored
182echo }
183) >> $InstallDir$/bacula-fd.conf
184
185[opsiservicecall_set_product_property_filedaemon_full_name]
186"method": "setProductProperty",
187"params": [
188 'bacula',
189 'filedaemon_full_name',
190 '$filedaemon_full_name$',
191 '%HostID%'
192]
193
194[opsiservicecall_set_product_property_filedaemon_monitor_name]
195"method": "setProductProperty",
196"params": [
197 'bacula',
198 'filedaemon_monitor_name',
199 '$filedaemon_monitor_name$',
200 '%HostID%'
201]
202
203
204[Files_install_32]
205; Example of recursively copying some files into the installation directory:
206;
207; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
208
209[Files_install_64]
210; Example of recursively copying some files into the installation directory:
211;
212; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
213
214[Registry_install]
215; Example of setting some values of an registry key:
216;
217; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
218; set "name1" = "some string value"
219; set "name2" = REG_DWORD:0001
220; set "name3" = REG_BINARY:00 af 99 cd
221
222[LinkFolder_install]
223; Example of deleting a folder from AllUsers startmenu:
224;
225; set_basefolder common_programs
226; delete_subfolder $ProductId$
227;
228; Example of creating an shortcut to the installed exe in AllUsers startmenu:
229;
230; set_basefolder common_programs
231; set_subfolder $ProductId$
232;
233; set_link
234; name: $ProductId$
235; target: <path to the program>
236; parameters:
237; working_dir: $InstallDir$
238; icon_file:
239; icon_index:
240; end_link
241;
242; Example of creating an shortcut to the installed exe on AllUsers desktop:
243;
244; set_basefolder common_desktopdirectory
245; set_subfolder ""
246;
247; set_link
248; name: $ProductId$
249; target: <path to the program>
250; parameters: <some_param>
251; working_dir: $InstallDir$
252; icon_file: <path to icon file>
253; icon_index: 2
254; end_link
255
256[Sub_get_licensekey]
257comment "License management is enabled and will be used"
258
259comment "Trying to get a license key"
260Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
261; If there is an assignment of exactly one licensepool to the product the following call is possible:
262; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
263;
264; If there is an assignment of a license pool to a windows software id, it is possible to use:
265; DefVar $WindowsSoftwareId$
266; $WindowsSoftwareId$ = "..."
267; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
268
269DefVar $ServiceErrorClass$
270set $ServiceErrorClass$ = getLastServiceErrorClass
271comment "Error class: " + $ServiceErrorClass$
272
273if $ServiceErrorClass$ = "None"
274 comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
275else
276 if $ServiceErrorClass$ = "LicenseConfigurationError"
277 LogError "Fatal: license configuration must be corrected"
278 LogError getLastServiceErrorMessage
279 isFatalError
280 else
281 if $ServiceErrorClass$ = "LicenseMissingError"
282 LogError "Fatal: required license is not supplied"
283 isFatalError
284 endif
285 endif
286endif
287
288[Sub_check_exitcode]
289comment "Test for installation success via exit code"
290set $ExitCode$ = getLastExitCode
291; informations to exit codes see
292; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
293; http://msdn.microsoft.com/en-us/library/aa368542.aspx
294if ($ExitCode$ = "0")
295 comment "Looks good: setup program gives exitcode zero"
296else
297 comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
298 if ($ExitCode$ = "1605")
299 comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
300 comment "Uninstall of a not installed product failed - no problem"
301 else
302 if ($ExitCode$ = "1641")
303 comment "looks good: setup program gives exitcode 1641"
304 comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
305 else
306 if ($ExitCode$ = "3010")
307 comment "looks good: setup program gives exitcode 3010"
308 comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
309 else
310 logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
311 isFatalError
312 endif
313 endif
314 endif
315endif
316
Note: See TracBrowser for help on using the repository browser.