Code

source: microsoft.securityessentials/CLIENT_DATA/setup3264.ins @ 3ae8cc

Revision 3ae8cc, 6.2 KB checked in by geos_one, 5 years ago (diff)

Reboot required

  • Property mode set to 100644
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.11.2.6"
8
9DefVar $UninstallProgram32$
10DefVar $UninstallProgramOld32$
11DefVar $IniFile32$
12DefVar $UninstallProgram64$
13DefVar $UninstallProgramOld64$
14DefVar $IniFile64$
15DefVar $IniCfgFile$
16DefVar $LogDir$
17DefVar $ProductId$ 
18DefVar $MinimumSpace$
19DefVar $InstallDir32$
20DefVar $InstallDir64$
21DefVar $ExitCode$
22DefVar $INST_SystemType$
23DefVar $INST_architecture$
24DefVar $OLD_VERSION$
25DefVar $OLD_CREATOR_TAG$
26DefVar $OLD_RELEASE$
27DefVar $Reboot$
28
29Set $INST_SystemType$ = GetSystemType
30set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
31
32Set $LogDir$ = "%SystemDrive%\tmp"
33
34; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
35; and adds the following variables:
36;   from builder-product.cfg :  all variables definded by attribute WINST[index]
37;   from builder-product.cfg :  VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE   
38;   from opsi-builder.cfg    :  CREATOR_TAG CREATOR_NAME CREATOR_EMAIL           
39;   auto generated winst-variables
40;         $IconFile$: path to product picture
41;
42@@BUILDER_VARIABLES@@
43
44; ----------------------------------------------------------------
45; - Please edit the following values                             -
46; ----------------------------------------------------------------
47;$ProductId$ should be the name of the product in opsi
48; therefore please: only lower letters, no umlauts,
49; no white space use '-' as a seperator
50Set $MinimumSpace$    = "60 MB"
51; the path were we find the product after the installation
52Set $InstallDir32$      = "%ProgramFiles32Dir%\Microsoft Security Client"
53Set $InstallDir64$      = "%ProgramFiles64Dir%\Microsoft Security Client"
54; ----------------------------------------------------------------
55
56Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
57
58if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
59        LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
60        isFatalError
61        ; Stop process and set installation status to failed
62else
63        comment "Show product picture"
64        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
65       
66        if FileExists("%ScriptPath%\delsub3264.ins")
67                comment "Start uninstall sub section"
68                Sub "%ScriptPath%\delsub3264.ins"
69        endif
70       
71        comment "installing"
72
73        if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
74                Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 32 Bit..."
75                comment "Start setup program"
76                ChangeDirectory "%SCRIPTPATH%"
77                Winbatch_install_32
78                Sub_check_exitcode
79                comment "Copy files"
80                Files_install_32 /32Bit
81                comment "Patch Registry"
82                Registry_install /32Bit
83                comment "Create shortcuts"
84                LinkFolder_install
85        endif
86
87        if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
88                Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..."
89                comment "Start setup program"
90                ChangeDirectory "%SCRIPTPATH%"
91                Winbatch_install_64
92                Sub_check_exitcode
93                comment "Copy files"
94                Files_install_64 /64Bit
95                comment "Patch Registry"
96                Registry_install /64Bit
97                comment "Create shortcuts"
98                LinkFolder_install
99        endif
100       
101endif
102
103[Winbatch_install_32]
104"$Install32Exe$" /s /runwgacheck
105
106[Files_install_32]
107; copy the ini file to the InstallDir
108copy "$IniCfgFile$" "$InstallDir32$"
109
110; Example of recursively copying some files into the installation directory:
111;
112; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
113
114[Winbatch_install_64]
115"$Install64Exe$" /s /runwgacheck
116
117[Files_install_64]
118; copy the ini file to the InstallDir
119copy "$IniCfgFile$" "$InstallDir64$"
120
121; Example of recursively copying some files into the installation directory:
122;
123; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
124
125[Registry_install]
126; Example of setting some values of an registry key:
127;
128; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
129; set "name1" = "some string value"
130; set "name2" = REG_DWORD:0001
131; set "name3" = REG_BINARY:00 af 99 cd
132
133[LinkFolder_install]
134; Example of deleting a folder from AllUsers startmenu:
135;
136; set_basefolder common_programs
137; delete_subfolder $ProductId$
138;
139; Example of creating an shortcut to the installed exe in AllUsers startmenu:
140;
141; set_basefolder common_programs
142; set_subfolder $ProductId$
143;
144; set_link
145;       name: $ProductId$
146;       target: <path to the program>
147;       parameters:
148;       working_dir: $InstallDir$
149;       icon_file:
150;       icon_index:
151; end_link
152;
153; Example of creating an shortcut to the installed exe on AllUsers desktop:
154;
155; set_basefolder common_desktopdirectory
156; set_subfolder ""
157;
158; set_link
159;       name: $ProductId$
160;       target: <path to the program>
161;       parameters: <some_param>
162;       working_dir: $InstallDir$
163;       icon_file: <path to icon file>
164;       icon_index: 2
165; end_link
166
167[Sub_check_exitcode]
168comment "Test for installation success via exit code"
169set $ExitCode$ = getLastExitCode
170; informations to exit codes see
171; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
172; http://msdn.microsoft.com/en-us/library/aa368542.aspx
173if ($ExitCode$ = "0")
174        comment "Looks good: setup program gives exitcode zero"
175else
176        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
177        if ($ExitCode$ = "1605")
178                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
179                comment "Uninstall of a not installed product failed - no problem"
180        else
181                if ($ExitCode$ = "1641")
182                        comment "looks good: setup program gives exitcode 1641"
183                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
184                else
185                        if ($ExitCode$ = "3010")
186                                comment "looks good: setup program gives exitcode 3010"
187                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
188                        else
189                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
190                                isFatalError
191                        endif
192                endif
193        endif
194endif
195
Note: See TracBrowser for help on using the repository browser.