Code

source: microsoft.securityessentials/CLIENT_DATA/setup3264.ins @ 6708cf

Revision 6708cf, 6.2 KB checked in by geos_one, 5 years ago (diff)

Correct installdir und uninstall programm

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