Code

source: openvpn.manager/CLIENT_DATA/delsub32.ins @ 822551

Revision 822551, 3.2 KB checked in by geos_one, 7 years ago (diff)

Intial Commit

  • 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 $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
8Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
9
10if FileExists($IniFile$)
11        Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
12        Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
13        Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
14endif
15Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
16
17if FileExists($IniFile$)
18        Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
19        Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
20        if FileExists($UninstallProgramOld$)
21                comment "Uninstall program found, starting uninstall"
22                Winbatch_uninstall_old /WaitforProcessending "Au_.exe" /Timeoutseconds 10
23                sub_check_exitcode
24        endif
25endif
26if FileExists($UninstallProgram$)
27        comment "Uninstall program found, starting uninstall"
28        Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
29        sub_check_exitcode
30endif
31
32comment "Delete files"
33Files_uninstall /32Bit
34
35comment "Cleanup registry"
36Registry_uninstall /32Bit
37
38comment "Delete program shortcuts"
39LinkFolder_uninstall
40
41[Winbatch_uninstall_old]
42"$UninstallProgramOld$" /S
43
44[Winbatch_uninstall]
45"$UninstallProgram$" /S
46
47[Files_uninstall]
48; Example for recursively deleting the installation directory:
49;
50del -sf "$InstallDir$\"
51
52[Registry_uninstall]
53; Example of deleting a registry key:
54;
55; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
56
57[LinkFolder_uninstall]
58; Example of deleting a folder from AllUsers startmenu:
59;
60; set_basefolder common_programs
61; delete_subfolder $ProductId$
62;
63; Example of deleting a shortcut from AllUsers desktop:
64;
65; set_basefolder common_desktopdirectory
66; set_subfolder ""
67; delete_element $ProductId$
68
69[Sub_check_exitcode]
70comment "Test for installation success via exit code"
71set $ExitCode$ = getLastExitCode
72; informations to exit codes see
73; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
74; http://msdn.microsoft.com/en-us/library/aa368542.aspx
75if ($ExitCode$ = "0")
76        comment "Looks good: setup program gives exitcode zero"
77else
78        comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
79        if ($ExitCode$ = "1605")
80                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
81                comment "Uninstall of a not installed product failed - no problem"
82        else
83                if ($ExitCode$ = "1641")
84                        comment "looks good: setup program gives exitcode 1641"
85                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
86                else
87                        if ($ExitCode$ = "3010")
88                                comment "looks good: setup program gives exitcode 3010"
89                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
90                        else
91                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
92                                isFatalError
93                        endif
94                endif
95        endif
96endif
97
Note: See TracBrowser for help on using the repository browser.