Code

source: kliu.fontreg/CLIENT_DATA/delsub3264.ins @ 0c2864

Revision 0c2864, 4.6 KB checked in by geos_one, 7 years ago (diff)

update to new opsi builder template

  • Property mode set to 100644
Line 
1; Copyright (c) uib gmbh (www.uib.de)
2; This sourcecode is owned by uib gmbh
3; and published under the Terms of the General Public License.
4; credits: http://www.opsi.org/en/credits/
5
6
7Set $UninstallProgram32$ = $InstallDir32$ + $UninstallProg32$
8Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
9
10Set $UninstallProgram64$ = $InstallDir64$ + $UninstallProg64$
11Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini"
12
13if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
14        if FileExists($IniFile32$)
15                Set $OLD_VERSION$ = GetValueFromInifile($IniFile32$,"COMMON","VERSION","")
16                Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile32$,"COMMON","CREATOR_TAG","")
17                Set $OLD_RELEASE$ = GetValueFromInifile($IniFile32$,"COMMON","RELEASE","")
18        endif
19        Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 32 Bit..."
20
21        if FileExists($IniFile32$)
22                Set $UninstallProg32$ = GetValueFromInifile($IniFile32$,"X86","UninstallProg32","XXXXXXXX.exe")
23                Set $UninstallProgramOld32$ = $InstallDir32$ + "\" + $UninstallProg32$
24                if FileExists($UninstallProgramOld32$)
25                        comment "Uninstall program found, starting uninstall"
26                        Files_uninstall_old_32
27                        sub_check_exitcode
28                endif
29        endif
30        if FileExists($UninstallProgram32$)
31                comment "Uninstall program found, starting uninstall"
32                Files_uninstall_32
33                sub_check_exitcode
34        endif
35
36        comment "Cleanup registry"
37        Registry_uninstall /32Bit
38endif
39
40if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
41        if FileExists($IniFile64$)
42                Set $OLD_VERSION$ = GetValueFromInifile($IniFile64$,"COMMON","VERSION","")
43                Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile64$,"COMMON","CREATOR_TAG","")
44                Set $OLD_RELEASE$ = GetValueFromInifile($IniFile64$,"COMMON","RELEASE","")
45        endif
46        Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 64 Bit..."
47
48        if FileExists($IniFile64$)
49                Set $UninstallProg64$ = GetValueFromInifile($IniFile64$,"X86_64","UninstallProg64","XXXXXXXX.exe")
50                Set $UninstallProgramOld64$ = $InstallDir64$ + "\" + $UninstallProg64$
51                if FileExists($UninstallProgramOld64$)
52                        comment "Uninstall program found, starting uninstall"
53                        Files_uninstall_old_64
54                        sub_check_exitcode
55                endif
56        endif
57        if FileExists($UninstallProgram64$)
58                comment "Uninstall program found, starting uninstall"
59                Files_uninstall_64
60                sub_check_exitcode
61        endif
62
63        comment "Cleanup registry"
64        Registry_uninstall /64Bit
65endif
66
67comment "Delete program shortcuts"
68LinkFolder_uninstall
69
70[Files_uninstall_old_32]
71delete -sf "$UninstallProgramOld32$"
72
73[Files_uninstall_32]
74delete -sf "$UninstallProgram32$"
75
76[Files_uninstall_old_64]
77delete -sf "$UninstallProgramOld64$"
78
79[Files_uninstall_64]
80delete -sf "$UninstallProgram64$"
81
82[Registry_uninstall]
83; Example of deleting a registry key:
84;
85; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
86
87[LinkFolder_uninstall]
88; Example of deleting a folder from AllUsers startmenu:
89;
90; set_basefolder common_programs
91; delete_subfolder $ProductId$
92;
93; Example of deleting a shortcut from AllUsers desktop:
94;
95; set_basefolder common_desktopdirectory
96; set_subfolder ""
97; delete_element $ProductId$
98
99[Sub_check_exitcode]
100comment "Test for installation success via exit code"
101set $ExitCode$ = getLastExitCode
102; informations to exit codes see
103; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
104; http://msdn.microsoft.com/en-us/library/aa368542.aspx
105if ($ExitCode$ = "0")
106        comment "Looks good: setup program gives exitcode zero"
107else
108        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
109        if ($ExitCode$ = "1605")
110                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
111                comment "Uninstall of a not installed product failed - no problem"
112        else
113                if ($ExitCode$ = "1641")
114                        comment "looks good: setup program gives exitcode 1641"
115                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
116                else
117                        if ($ExitCode$ = "3010")
118                                comment "looks good: setup program gives exitcode 3010"
119                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
120                        else
121                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
122                                isFatalError
123                        endif
124                endif
125        endif
126endif
127
Note: See TracBrowser for help on using the repository browser.