source: opsi/products/bacula/CLIENT_DATA/delsub3264.ins@ 1265

Last change on this file since 1265 was 1104, checked in by joergs, on Sep 21, 2012 at 5:35:30 PM

stop server on uninstall

File size: 4.3 KB
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; stop service, if running
7DosBatch_stop_bacula-fd
8
9;Set $MsiId32$ = 'Bacula'
10Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe"
11
12;Set $MsiId64$ = 'Bacula'
13Set $UninstallProgram64$ = $InstallDir64$ + "\uninstall.exe"
14
15if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
16 Message "Uninstalling " + $ProductId$ + " 32 Bit..."
17
18 if FileExists($UninstallProgram32$)
19 comment "Uninstall program found, starting uninstall"
20 Winbatch_uninstall_32
21 sub_check_exitcode
22 endif
23
24 ;if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "")
25 ; comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall"
26 ; Winbatch_uninstall_msi_32
27 ; sub_check_exitcode
28 ;endif
29
30 ;comment "Delete files"
31 ;Files_uninstall_32 /32Bit
32 ;comment "Cleanup registry"
33 ;Registry_uninstall /32Bit
34endif
35
36if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
37 Message "Uninstalling " + $ProductId$ + " 64 Bit..."
38
39 if FileExists($UninstallProgram64$)
40 comment "Uninstall program found, starting uninstall"
41 Winbatch_uninstall_64
42 sub_check_exitcode
43 endif
44
45 ;if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId64$ + "] DisplayName") = "")
46 ; comment "MSI id " + $MsiId64$ + " found in registry, starting msiexec to uninstall"
47 ; Winbatch_uninstall_msi_64
48 ; sub_check_exitcode
49 ;endif
50
51 ;comment "Delete files"
52 ;Files_uninstall_64 /64Bit
53 ;comment "Cleanup registry"
54 ;Registry_uninstall /64Bit
55endif
56
57;comment "Delete program shortcuts"
58;LinkFolder_uninstall
59
60
61[DosBatch_stop_bacula-fd]
62net stop bacula-fd
63
64
65[Winbatch_uninstall_32]
66"$UninstallProgram32$" /S
67
68
69[Winbatch_uninstall_64]
70"$UninstallProgram64$" /S
71
72
73[Winbatch_uninstall_msi_32]
74msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
75
76[Files_uninstall_32]
77; Example for recursively deleting the installation directory (don't forget the trailing backslash):
78;
79; delete -sf "$InstallDir32$\"
80
81
82
83[Winbatch_uninstall_msi_64]
84msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
85
86[Files_uninstall_64]
87; Example for recursively deleting the installation directory (don't forget the trailing backslash):
88;
89; delete -sf "$InstallDir64$\"
90
91[Registry_uninstall]
92; Example of deleting a registry key:
93;
94; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
95
96[LinkFolder_uninstall]
97; Example of deleting a folder from AllUsers startmenu:
98;
99; set_basefolder common_programs
100; delete_subfolder $ProductId$
101;
102; Example of deleting a shortcut from AllUsers desktop:
103;
104; set_basefolder common_desktopdirectory
105; set_subfolder ""
106; delete_element $ProductId$
107
108[Sub_check_exitcode]
109comment "Test for installation success via exit code"
110set $ExitCode$ = getLastExitCode
111; informations to exit codes see
112; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
113; http://msdn.microsoft.com/en-us/library/aa368542.aspx
114if ($ExitCode$ = "0")
115 comment "Looks good: setup program gives exitcode zero"
116else
117 comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
118 if ($ExitCode$ = "1605")
119 comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
120 comment "Uninstall of a not installed product failed - no problem"
121 else
122 if ($ExitCode$ = "1641")
123 comment "looks good: setup program gives exitcode 1641"
124 comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
125 else
126 if ($ExitCode$ = "3010")
127 comment "looks good: setup program gives exitcode 3010"
128 comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
129 else
130 logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
131 isFatalError
132 endif
133 endif
134 endif
135endif
136
Note: See TracBrowser for help on using the repository browser.