VBoxGuestAdditionsUninstall.nsh revision 2f14f4556ae74ad40719bc9690534693abb71868
2N/A;*
2N/A;* @file
2N/A;* VBoxGuestAdditionsUninstall.nsh - Guest Additions uninstallation.
2N/A;*
2N/A
2N/A;*
2N/A;* Copyright (C) 2011 Oracle Corporation
2N/A;*
2N/A;* This file is part of VirtualBox Open Source Edition (OSE), as
2N/A;* available from http://www.virtualbox.org. This file is free software;
2N/A;* you can redistribute it and/or modify it under the terms of the GNU
2N/A;* General Public License (GPL) as published by the Free Software
2N/A;* Foundation, in version 2 as it comes in the "COPYING" file of the
2N/A;* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2N/A;* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2N/A;*
2N/A
2N/A!macro UninstallCommon un
2N/AFunction ${un}UninstallCommon
2N/A
2N/A Delete /REBOOTOK "$INSTDIR\install.log"
2N/A Delete /REBOOTOK "$INSTDIR\uninst.exe"
2N/A Delete /REBOOTOK "$INSTDIR\${PRODUCT_NAME}.url"
2N/A
2N/A ; Remove common files
2N/A Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe"
2N/A Delete /REBOOTOK "$INSTDIR\DIFxAPI.dll"
2N/A
2N/A Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
2N/A!ifdef VBOX_SIGN_ADDITIONS
2N/A Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
2N/A!endif
2N/A
2N/A!if $%VBOX_WITH_LICENSE_INSTALL_RTF% == "1"
2N/A Delete /REBOOTOK "$INSTDIR\${LICENSE_FILE_RTF}"
2N/A!endif
2N/A
2N/A Delete /REBOOTOK "$INSTDIR\VBoxGINA.dll"
2N/A Delete /REBOOTOK "$INSTDIR\iexplore.ico"
2N/A
2N/A ; Delete registry keys
2N/A DeleteRegKey /ifempty HKLM "${PRODUCT_INSTALL_KEY}"
2N/A DeleteRegKey /ifempty HKLM "${VENDOR_ROOT_KEY}"
2N/A
2N/A ; Delete desktop & start menu entries
2N/A Delete "$DESKTOP\${PRODUCT_NAME} Guest Additions.lnk"
2N/A Delete "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions\Uninstall.lnk"
2N/A Delete "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions\Website.lnk"
2N/A RMDIR "$SMPROGRAMS\${PRODUCT_NAME} Guest Additions"
2N/A
2N/A ; Delete Guest Additions directory (only if completely empty)
2N/A RMDir /REBOOTOK "$INSTDIR"
2N/A
2N/A ; Delete vendor installation directory (only if completely empty)
2N/A!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
2N/A RMDir /REBOOTOK "$PROGRAMFILES32\$%VBOX_VENDOR_SHORT%"
2N/A!else ; 64-bit
2N/A RMDir /REBOOTOK "$PROGRAMFILES64\$%VBOX_VENDOR_SHORT%"
2N/A!endif
2N/A
2N/A ; Remove registry entries
2N/A DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
2N/A
2N/AFunctionEnd
2N/A!macroend
2N/A!insertmacro UninstallCommon ""
2N/A!insertmacro UninstallCommon "un."
2N/A
2N/A!macro Uninstall un
2N/AFunction ${un}Uninstall
2N/A
2N/A DetailPrint "Uninstalling system files ..."
2N/A!ifdef _DEBUG
2N/A DetailPrint "Detected OS version: Windows $g_strWinVersion"
2N/A DetailPrint "System Directory: $g_strSystemDir"
!endif
; Which OS are we using?
!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
!endif
StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
StrCmp $g_strWinVersion "XP" w2k ; Windows XP
StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
StrCmp $g_strWinVersion "7" vista ; Windows 7
${If} $g_bForceInstall == "true"
Goto vista ; Assume newer OS than we know of ...
${EndIf}
Goto notsupported
!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
nt4:
Call ${un}NT4_Uninstall
goto common
!endif
w2k:
Call ${un}W2K_Uninstall
goto common
vista:
Call ${un}W2K_Uninstall
Call ${un}Vista_Uninstall
goto common
notsupported:
MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
Goto exit
common:
exit:
FunctionEnd
!macroend
!insertmacro Uninstall ""
!insertmacro Uninstall "un."
!macro UninstallInstDir un
Function ${un}UninstallInstDir
DetailPrint "Uninstalling directory ..."
!ifdef _DEBUG
DetailPrint "Detected OS version: Windows $g_strWinVersion"
DetailPrint "System Directory: $g_strSystemDir"
!endif
; Which OS are we using?
!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
!endif
StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
StrCmp $g_strWinVersion "XP" w2k ; Windows XP
StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
StrCmp $g_strWinVersion "7" vista ; Windows 7
${If} $g_bForceInstall == "true"
Goto vista ; Assume newer OS than we know of ...
${EndIf}
Goto notsupported
!if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit
nt4:
Call ${un}NT4_UninstallInstDir
goto common
!endif
w2k:
Call ${un}W2K_UninstallInstDir
goto common
vista:
Call ${un}W2K_UninstallInstDir
Call ${un}Vista_UninstallInstDir
goto common
notsupported:
MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
Goto exit
common:
Call ${un}UninstallCommon
exit:
FunctionEnd
!macroend
!insertmacro UninstallInstDir ""
!insertmacro UninstallInstDir "un."