1 |
|
---|
2 | !macro UninstallCommon un
|
---|
3 | Function ${un}UninstallCommon
|
---|
4 |
|
---|
5 | Delete /REBOOTOK "$INSTDIR\install.log"
|
---|
6 | Delete /REBOOTOK "$INSTDIR\uninst.exe"
|
---|
7 | Delete /REBOOTOK "$INSTDIR\${PRODUCT_NAME}.url"
|
---|
8 |
|
---|
9 | ; Remove common files
|
---|
10 | Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe"
|
---|
11 | Delete /REBOOTOK "$INSTDIR\DIFxAPI.dll"
|
---|
12 |
|
---|
13 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
|
---|
14 | !ifdef VBOX_SIGN_ADDITIONS
|
---|
15 | Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
|
---|
16 | !endif
|
---|
17 |
|
---|
18 | !ifdef VBOX_WITH_LICENSE_INSTALL_RTF
|
---|
19 | Delete /REBOOTOK "$INSTDIR\${LICENSE_FILE_RTF}"
|
---|
20 | !endif
|
---|
21 |
|
---|
22 | Delete /REBOOTOK "$INSTDIR\VBoxGINA.dll"
|
---|
23 | Delete /REBOOTOK "$INSTDIR\iexplore.ico"
|
---|
24 |
|
---|
25 | ; Delete registry keys
|
---|
26 | DeleteRegKey /ifempty HKLM "${PRODUCT_INSTALL_KEY}"
|
---|
27 | DeleteRegKey /ifempty HKLM "${VENDOR_ROOT_KEY}"
|
---|
28 |
|
---|
29 | ; Delete desktop & start menu entries
|
---|
30 | Delete "$DESKTOP\${PRODUCT_NAME} Guest Additions.lnk"
|
---|
31 | Delete "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions\Uninstall.lnk"
|
---|
32 | Delete "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions\Website.lnk"
|
---|
33 | RMDIR "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions"
|
---|
34 |
|
---|
35 | ; Delete Guest Additions directory (only if completely empty)
|
---|
36 | RMDir /REBOOTOK "$INSTDIR"
|
---|
37 |
|
---|
38 | ; Delete vendor installation directory (only if completely empty)
|
---|
39 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
40 | RMDir /REBOOTOK "$PROGRAMFILES32\$%VBOX_VENDOR_SHORT%"
|
---|
41 | !else ; 64-bit
|
---|
42 | RMDir /REBOOTOK "$PROGRAMFILES64\$%VBOX_VENDOR_SHORT%"
|
---|
43 | !endif
|
---|
44 |
|
---|
45 | ; Remove registry entries
|
---|
46 | DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
---|
47 |
|
---|
48 | FunctionEnd
|
---|
49 | !macroend
|
---|
50 | !insertmacro UninstallCommon ""
|
---|
51 | !insertmacro UninstallCommon "un."
|
---|
52 |
|
---|
53 | !macro Uninstall un
|
---|
54 | Function ${un}Uninstall
|
---|
55 |
|
---|
56 | DetailPrint "Uninstalling system files ..."
|
---|
57 | !ifdef _DEBUG
|
---|
58 | DetailPrint "Detected OS version: Windows $g_strWinVersion"
|
---|
59 | DetailPrint "System Directory: $g_strSystemDir"
|
---|
60 | !endif
|
---|
61 |
|
---|
62 | ; Which OS are we using?
|
---|
63 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
64 | StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
|
---|
65 | !endif
|
---|
66 | StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
|
---|
67 | StrCmp $g_strWinVersion "XP" w2k ; Windows XP
|
---|
68 | StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
|
---|
69 | StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
|
---|
70 | StrCmp $g_strWinVersion "7" vista ; Windows 7
|
---|
71 |
|
---|
72 | ${If} $g_bForceInstall == "true"
|
---|
73 | Goto vista ; Assume newer OS than we know of ...
|
---|
74 | ${EndIf}
|
---|
75 |
|
---|
76 | Goto notsupported
|
---|
77 |
|
---|
78 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
79 | nt4:
|
---|
80 |
|
---|
81 | Call ${un}NT_Uninstall
|
---|
82 | goto common
|
---|
83 | !endif
|
---|
84 |
|
---|
85 | w2k:
|
---|
86 |
|
---|
87 | Call ${un}W2K_Uninstall
|
---|
88 | goto common
|
---|
89 |
|
---|
90 | vista:
|
---|
91 |
|
---|
92 | Call ${un}W2K_Uninstall
|
---|
93 | Call ${un}Vista_Uninstall
|
---|
94 | goto common
|
---|
95 |
|
---|
96 | notsupported:
|
---|
97 |
|
---|
98 | MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
|
---|
99 | Goto exit
|
---|
100 |
|
---|
101 | common:
|
---|
102 |
|
---|
103 | exit:
|
---|
104 |
|
---|
105 | FunctionEnd
|
---|
106 | !macroend
|
---|
107 | !insertmacro Uninstall ""
|
---|
108 | !insertmacro Uninstall "un."
|
---|
109 |
|
---|
110 | !macro UninstallInstDir un
|
---|
111 | Function ${un}UninstallInstDir
|
---|
112 |
|
---|
113 | DetailPrint "Uninstalling directory ..."
|
---|
114 | !ifdef _DEBUG
|
---|
115 | DetailPrint "Detected OS version: Windows $g_strWinVersion"
|
---|
116 | DetailPrint "System Directory: $g_strSystemDir"
|
---|
117 | !endif
|
---|
118 |
|
---|
119 | ; Which OS are we using?
|
---|
120 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
121 | StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
|
---|
122 | !endif
|
---|
123 | StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
|
---|
124 | StrCmp $g_strWinVersion "XP" w2k ; Windows XP
|
---|
125 | StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
|
---|
126 | StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
|
---|
127 | StrCmp $g_strWinVersion "7" vista ; Windows 7
|
---|
128 |
|
---|
129 | ${If} $g_bForceInstall == "true"
|
---|
130 | Goto vista ; Assume newer OS than we know of ...
|
---|
131 | ${EndIf}
|
---|
132 |
|
---|
133 | Goto notsupported
|
---|
134 |
|
---|
135 | !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
|
---|
136 | nt4:
|
---|
137 |
|
---|
138 | Call ${un}NT_UninstallInstDir
|
---|
139 | goto common
|
---|
140 | !endif
|
---|
141 |
|
---|
142 | w2k:
|
---|
143 |
|
---|
144 | Call ${un}W2K_UninstallInstDir
|
---|
145 | goto common
|
---|
146 |
|
---|
147 | vista:
|
---|
148 |
|
---|
149 | Call ${un}W2K_UninstallInstDir
|
---|
150 | Call ${un}Vista_UninstallInstDir
|
---|
151 | goto common
|
---|
152 |
|
---|
153 | notsupported:
|
---|
154 |
|
---|
155 | MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
|
---|
156 | Goto exit
|
---|
157 |
|
---|
158 | common:
|
---|
159 |
|
---|
160 | Call ${un}UninstallCommon
|
---|
161 |
|
---|
162 | exit:
|
---|
163 |
|
---|
164 | FunctionEnd
|
---|
165 | !macroend
|
---|
166 | !insertmacro UninstallInstDir ""
|
---|
167 | !insertmacro UninstallInstDir "un."
|
---|