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

Last change on this file since 1155 was 1137, checked in by joergs, on Jan 24, 2013 at 3:07:03 PM

switched from Winbatch to ShellBatch /sysnative. Prevent problem on x64? include wsusoffline native log file

File size: 5.3 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 $MsiId32$
11DefVar $UninstallProgram32$
12DefVar $MsiId64$
13DefVar $UninstallProgram64$
14DefVar $LogDir$
15DefVar $ProductId$
16DefVar $MinimumSpace$
17DefVar $InstallDir32$
18DefVar $InstallDir64$
19DefVar $ExitCode$
20DefVar $LicenseRequired$
21DefVar $LicenseKey$
22DefVar $LicensePool$
23DefVar $INST_SystemType$
24DefVar $INST_architecture$
25
26Set $INST_SystemType$ = GetSystemType
27
28;
29; get product properties for options
30;
31; multi-value values are return as string, seperated by ",", eg. "value1,value2,value3",
32; therefore we replace "," by " " (split, compose)
33;
34DefVar $Options$
35Set $Options$ = composeString( splitString ( GetProductProperty("options",""), "," ), " " )
36
37comment "options: " + $Options$
38
39Set $LogDir$ = "%SystemDrive%\tmp"
40
41; ----------------------------------------------------------------
42; - Please edit the following values -
43; ----------------------------------------------------------------
44;$ProductId$ should be the name of the product in opsi
45; therefore please: only lower letters, no umlauts,
46; no white space use '-' as a seperator
47Set $ProductId$ = "wsusoffline"
48Set $MinimumSpace$ = "300 MB"
49; the path were we find the product after the installation
50;Set $InstallDir32$ = "%ProgramFiles32Dir%\<path to the product>"
51;Set $InstallDir64$ = "%ProgramFiles64Dir%\<path to the product>"
52;Set $LicenseRequired$ = "false"
53;Set $LicensePool$ = "p_" + $ProductId$
54; ----------------------------------------------------------------
55
56if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
57 LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
58 isFatalError
59 ; Stop process and set installation status to failed
60endif
61
62comment "Show product picture"
63ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
64
65;if FileExists("%ScriptPath%\delsub3264.ins")
66; comment "Start uninstall sub section"
67; Sub "%ScriptPath%\delsub3264.ins"
68;endif
69
70comment "installing"
71Message "Installing " + $ProductId$ + " ..."
72
73comment "Start setup program"
74;Winbatch_install
75Shellbatch_install /sysnative
76
77; include wsusoffline logfile (last 1000 lines)
78includelog "%Systemroot%\wsusofflineupdate.log" "1000"
79
80; check exit code, reboot is required
81Sub_check_exitcode
82
83;comment "Copy files"
84;Files_install_32 /32Bit
85;comment "Patch Registry"
86;Registry_install /32Bit
87
88
89
90;[Winbatch_install]
91;"%ScriptPath%\exit-wrapper.cmd" "%ScriptPath%\client\cmd\DoUpdate.cmd" $Options$
92
93
94
95[ShellBatch_install]
96@rem remove old wsusoffline logfile
97del /q "%Systemroot%\wsusofflineupdate.log"
98call "%ScriptPath%\client\cmd\DoUpdate.cmd" $Options$
99exit %ERRORLEVEL%
100
101
102
103[Files_install_32]
104; Example of recursively copying some files into the installation directory:
105;
106; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
107
108[Registry_install]
109; Example of setting some values of an registry key:
110;
111; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
112; set "name1" = "some string value"
113; set "name2" = REG_DWORD:0001
114; set "name3" = REG_BINARY:00 af 99 cd
115
116
117[Sub_check_exitcode]
118comment "Test for installation success via exit code"
119set $ExitCode$ = getLastExitCode
120; informations to exit codes see
121; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
122; http://msdn.microsoft.com/en-us/library/aa368542.aspx
123if ($ExitCode$ = "0")
124 comment "Looks good: setup program gives exitcode zero"
125else
126 comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
127 if ($ExitCode$ = "1605")
128 comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
129 comment "Uninstall of a not installed product failed - no problem"
130 else
131 if ($ExitCode$ = "1641")
132 comment "looks good: setup program gives exitcode 1641"
133 comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
134 ExitWindows /Reboot
135 else
136 if ($ExitCode$ = "3010")
137 comment "looks good: setup program gives exitcode 3010"
138 comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
139 ExitWindows /Reboot
140 else
141 if ($ExitCode$ = "3011")
142 comment "looks good: setup program gives exitcode 3011"
143 comment "ERROR_SUCCESS: wsusoffline requires reboot and rerun."
144 ExitWindows /ImmediateReboot
145 else
146 logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
147 isFatalError
148 endif
149 endif
150 endif
151 endif
152endif
153
Note: See TracBrowser for help on using the repository browser.