source: opsi/products/wsusoffline/CLIENT_DATA/setup.ins@ 1233

Last change on this file since 1233 was 1156, checked in by joergs, on Jul 4, 2013 at 5:16:57 PM

bugfix 64bit, cleanup

File size: 4.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/credits/
5
6[Actions]
7; at least 4.11.2, tested with 4.11.3.3
8requiredWinstVersion >= "4.11.3.3"
9
10DefVar $LogDir$
11DefVar $ProductId$
12DefVar $MinimumSpace$
13DefVar $ExitCode$
14DefVar $INST_SystemType$
15DefVar $INST_architecture$
16
17Set $INST_SystemType$ = GetSystemType
18
19;
20; get product properties for options
21;
22; multi-value values are return as string, seperated by ",", eg. "value1,value2,value3",
23; therefore we replace "," by " " (split, compose)
24;
25DefVar $Options$
26Set $Options$ = composeString( splitString ( GetProductProperty("options",""), "," ), " " )
27
28comment "options: " + $Options$
29
30Set $LogDir$ = "%SystemDrive%\tmp"
31
32; ----------------------------------------------------------------
33; - Please edit the following values -
34; ----------------------------------------------------------------
35;$ProductId$ should be the name of the product in opsi
36; therefore please: only lower letters, no umlauts,
37; no white space use '-' as a seperator
38Set $ProductId$ = "wsusoffline"
39Set $MinimumSpace$ = "1000 MB"
40; ----------------------------------------------------------------
41
42if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
43 LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
44 isFatalError
45 ; Stop process and set installation status to failed
46endif
47
48comment "Show product picture"
49ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
50
51comment "installing"
52Message "Installing " + $ProductId$ + " ..."
53
54comment "Start setup program"
55;Winbatch_install
56Shellbatch_install /winst /sysnative
57
58; include wsusoffline logfile (last 1000 lines)
59includelog "%Systemroot%\wsusofflineupdate.log" "1000"
60
61; check exit code, reboot is required
62Sub_check_exitcode
63
64
65[ShellBatch_install]
66@rem remove old wsusoffline logfile
67del /q "%Systemroot%\wsusofflineupdate.log"
68call "%ScriptPath%\client\cmd\DoUpdate.cmd" $Options$
69exit %ERRORLEVEL%
70
71
72[Sub_check_exitcode]
73comment "Test for installation success via exit code"
74set $ExitCode$ = getLastExitCode
75; informations to exit codes see
76; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
77; http://msdn.microsoft.com/en-us/library/aa368542.aspx
78if ($ExitCode$ = "0")
79 comment "Looks good: setup program gives exitcode zero"
80else
81 comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
82 if ($ExitCode$ = "1605")
83 comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
84 comment "Uninstall of a not installed product failed - no problem"
85 else
86 if ($ExitCode$ = "1641")
87 comment "looks good: setup program gives exitcode 1641"
88 comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
89 ExitWindows /Reboot
90 else
91 if ($ExitCode$ = "3010")
92 comment "looks good: setup program gives exitcode 3010"
93 comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
94 ExitWindows /Reboot
95 else
96 if ($ExitCode$ = "3011")
97 comment "looks good: setup program gives exitcode 3011"
98 comment "ERROR_SUCCESS: wsusoffline requires reboot and rerun."
99 ExitWindows /ImmediateReboot
100 else
101 logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
102 isFatalError
103 endif
104 endif
105 endif
106 endif
107endif
108
Note: See TracBrowser for help on using the repository browser.