VirtualBox

Ignore:
Timestamp:
Mar 27, 2025 3:32:33 PM (6 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168200
Message:

Windows Guest Additions installer: Big revamp of the overall source code structure to (hopefully) make it a lot more clear and removed code duplication. There has been a lot of code rot being accumulated over the last decade. Added lots of missing and fixes for documentation. Also revamped the installed files structure so that we have component sub folders to make it more clear which file belongs to what. Older Guest Additions will be migrated automatically. Tested upgrades with 7.1, 7.0 and 6.1 Guest Additions. bugref:10881

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstallOld.nsh

    r106061 r108772  
    11; $Id$
    22;; @file
    3 ; VBoxGuestAdditionsUninstallOld.nsh - Guest Additions uninstallation handling for legacy packages.
     3; VBoxGuestAdditionsUninstallOld.nsh - Guest Additions uninstallation and migration handling
     4; for older Guest Additions and legacy (Sun [xVM] / innotek) packages.
    45;
    56
     
    2627;
    2728
    28 !ifdef UNUSED_CODE
    29 !macro Uninstall_RunExtUnInstaller un
    30 Function ${un}Uninstall_RunExtUnInstaller
    31 
    32   Pop  $0
    33   Push $1
    34   Push $2
    35 
    36   ; Try to run the current uninstaller
    37   StrCpy $1 "$0\uninst.exe"
    38   IfFileExists "$1" run 0
    39     MessageBox MB_OK "VirtualBox Guest Additions uninstaller not found! Path = $1" /SD IDOK
    40     StrCpy $0 1 ; Tell the caller that we were not able to start the uninstaller
    41     Goto exit
    42 
    43 run:
    44 
    45   ; Always try to run in silent mode
    46   Goto run_uninst_silent
    47 
    48 run_uninst_silent:
    49 
    50   ExecWait '"$1" /S _?=$0' $2 ; Silently run uninst.exe in it's dir and don't copy it to a temp. location
    51   Goto handle_result
    52 
    53 run_uninst:
    54 
    55   ExecWait '"$1" _?=$0' $2 ; Run uninst.exe in it's dir and don't copy it to a temp. location
    56   Goto handle_result
    57 
    58 handle_result:
    59 
    60   ; Note that here a race might going on after the user clicked on
    61   ; "Reboot now" in the installer ran above and this installer cleaning
    62   ; up afterwards
    63 
    64   ; ... so try to abort the current reboot / shutdown caused by the installer ran before
    65   Call ${un}AbortShutdown
    66 
    67 ;!ifdef _DEBUG
    68 ;      MessageBox MB_OK 'Debug Message: Uninstaller was called, result is: $2' /SD IDOK
    69 ;!endif
    70 
    71   ${Switch} $2 ; Check exit codes
    72     ${Case} 1  ; Aborted by user
    73       StrCpy $0 1 ; Tell the caller that we were aborted by the user
    74       ${Break}
    75     ${Case} 2  ; Aborted by script (that might be okay)
    76       StrCpy $0 0 ; All went well
    77       ${Break}
    78     ${Default} ; Normal exixt
    79       StrCpy $0 0 ; All went well
    80       ${Break}
    81   ${EndSwitch}
    82   Goto exit
    83 
    84 exit:
    85 
    86   Pop $2
    87   Pop $1
    88   Push $0
    89 
    90 FunctionEnd
    91 !macroend
    92 !insertmacro Uninstall_RunExtUnInstaller ""
    93 !insertmacro Uninstall_RunExtUnInstaller "un."
    94 !endif ; UNUSED_CODE
    95 
    9629!macro Uninstall_WipeInstallationDirectory un
     30;;
     31; Wipes the installation directory (recursively).
     32;
     33; Only used for wiping legacy installations (innotek, Sun, Sun xVM).
     34;
     35; Input:
     36;   Stack[0]: Installation directory to wipe.
     37; Output:
     38;   Stack[0}: Return code. 0 means success.
     39;
    9740Function ${un}Uninstall_WipeInstallationDirectory
    9841
     
    11861
    11962  RMDir /r /REBOOTOK "$0"
    120   StrCpy $0 0 ; All went well
     63  StrCpy $0 0 ; All went well.
    12164  Goto exit
    12265
     
    12467
    12568  ${LogVerbose} "Won't remove directory ($0)!"
    126   StrCpy $0 1 ; Signal some failure
     69  StrCpy $0 1 ; Signal some failure.
    12770  Goto exit
    12871
     
    13780!insertmacro Uninstall_WipeInstallationDirectory ""
    13881
    139 ; This function cleans up an old Sun installation
     82
     83!ifndef UNINSTALLER_ONLY
     84!macro Uninstall_Before7_2 un
     85;;
     86; Uninstalls all files of a < 7.2 Guest Additions installation.
     87;
     88; These were stored in a "flat" hierarchy directly in the installation directory,
     89; which made it impossible to tell which files belong to which component.
     90;
     91; This also will be run when installing 7.2 Guest Additions to clean things up.
     92;
     93; Input:
     94;   None
     95; Output:
     96;   None
     97;
     98Function ${un}Uninstall_Before7_2
     99
     100  Delete /REBOOTOK "$INSTDIR\VBoxVideo.sys"
     101  Delete /REBOOTOK "$INSTDIR\VBoxVideo.inf"
     102  Delete /REBOOTOK "$INSTDIR\VBoxVideo.cat"
     103  Delete /REBOOTOK "$INSTDIR\VBoxVideoEarlyNT.inf"
     104  Delete /REBOOTOK "$INSTDIR\VBoxVideoEarlyNT.cat"
     105  Delete /REBOOTOK "$INSTDIR\VBoxDisp.dll"
     106
     107  Delete /REBOOTOK "$INSTDIR\VBoxMouse.sys"
     108  Delete /REBOOTOK "$INSTDIR\VBoxMouse.inf"
     109  Delete /REBOOTOK "$INSTDIR\VBoxMouse.cat"
     110
     111  Delete /REBOOTOK "$INSTDIR\VBoxTray.exe"
     112
     113  Delete /REBOOTOK "$INSTDIR\VBoxGuest.sys"
     114  Delete /REBOOTOK "$INSTDIR\VBoxGuest.inf"
     115  Delete /REBOOTOK "$INSTDIR\VBoxGuest.cat"
     116  Delete /REBOOTOK "$INSTDIR\VBoxGuestEarlyNT.inf"
     117  Delete /REBOOTOK "$INSTDIR\VBoxGuestEarlyNT.cat"
     118
     119  Delete /REBOOTOK "$INSTDIR\VBCoInst.dll"    ; Deprecated, does not get installed anymore.
     120  Delete /REBOOTOK "$INSTDIR\VBoxControl.exe"
     121  Delete /REBOOTOK "$INSTDIR\VBoxService.exe"
     122  Delete /REBOOTOK "$INSTDIR\VBoxWHQLFake.exe"; Removed in r152293 (runup to 7.0).
     123  Delete /REBOOTOK "$INSTDIR\VBoxICD.dll"     ; Removed in r151892 (runup to 7.0).
     124
     125!if $%VBOX_WITH_WDDM% == "1"
     126  Delete /REBOOTOK "$INSTDIR\VBoxWddm.cat"
     127  Delete /REBOOTOK "$INSTDIR\VBoxWddm.sys"
     128  Delete /REBOOTOK "$INSTDIR\VBoxWddm.inf"
     129  ; Obsolete files begin
     130  Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.cat"
     131  Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.sys"
     132  Delete /REBOOTOK "$INSTDIR\VBoxVideoWddm.inf"
     133  Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.cat"
     134  Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.sys"
     135  Delete /REBOOTOK "$INSTDIR\VBoxVideoW8.inf"
     136  ; Obsolete files end
     137  Delete /REBOOTOK "$INSTDIR\VBoxDispD3D.dll"
     138  !if $%VBOX_WITH_WDDM_DX% == "1"
     139    Delete /REBOOTOK "$INSTDIR\VBoxDX.dll"
     140  !endif
     141  !if $%VBOX_WITH_MESA3D% == "1"
     142    Delete /REBOOTOK "$INSTDIR\VBoxNine.dll"
     143    Delete /REBOOTOK "$INSTDIR\VBoxSVGA.dll"
     144    Delete /REBOOTOK "$INSTDIR\VBoxICD.dll"
     145    Delete /REBOOTOK "$INSTDIR\VBoxGL.dll"
     146  !endif
     147
     148    Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm.dll"
     149    Delete /REBOOTOK "$INSTDIR\wined3dwddm.dll"
     150    ; Try to delete libWine in case it is there from old installation.
     151    Delete /REBOOTOK "$INSTDIR\libWine.dll"
     152
     153  !if $%KBUILD_TARGET_ARCH% == "amd64"
     154    Delete /REBOOTOK "$INSTDIR\VBoxDispD3D-x86.dll"
     155    !if $%VBOX_WITH_WDDM_DX% == "1"
     156      Delete /REBOOTOK "$INSTDIR\VBoxDX-x86.dll"
     157    !endif
     158    !if $%VBOX_WITH_MESA3D% == "1"
     159      Delete /REBOOTOK "$INSTDIR\VBoxNine-x86.dll"
     160      Delete /REBOOTOK "$INSTDIR\VBoxSVGA-x86.dll"
     161      Delete /REBOOTOK "$INSTDIR\VBoxICD-x86.dll"
     162      Delete /REBOOTOK "$INSTDIR\VBoxGL-x86.dll"
     163    !endif
     164
     165      Delete /REBOOTOK "$INSTDIR\VBoxD3D9wddm-x86.dll"
     166      Delete /REBOOTOK "$INSTDIR\wined3dwddm-x86.dll"
     167  !endif ; $%KBUILD_TARGET_ARCH% == "amd64"
     168!endif ; $%VBOX_WITH_WDDM% == "1"
     169
     170  Delete /REBOOTOK "$INSTDIR\RegCleanup.exe" ; Obsolete since r165894 (see #10799).
     171  Delete /REBOOTOK "$INSTDIR\VBoxDrvInst.exe"
     172  Delete /REBOOTOK "$INSTDIR\VBoxGuestInstallHelper.exe"
     173
     174  Delete "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" ; Old name. Changed to Website.url in r153663.
     175  Delete "$DESKTOP\${PRODUCT_NAME}.lnk"            ; Obsolete. We don't install a desktop link any more.
     176
     177FunctionEnd
     178!macroend
     179!insertmacro Uninstall_Before7_2 ""
     180!endif ; UNINSTALLER_ONLY
     181
     182
    140183!macro Uninstall_Sun un
     184;;
     185; Function to clean  up an old Sun (pre-Oracle) installation.
     186;
     187; Input:
     188;   None
     189; Output:
     190;   None
     191;
    141192Function ${un}Uninstall_Sun
    142193
     
    145196  Push $2
    146197
    147   ; Get current installation path
     198  ; Get current installation path.
    148199  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
    149200  StrCmp $0 "" exit
     
    162213  StrCmp $1 "" exit
    163214
    164   ; Save current i8042prt info to new uninstall registry path
    165   ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" ${ORG_MOUSE_PATH}
    166   WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH} $0
    167 
    168   ; Try to wipe current installation directory
    169   Push $1 ; Push uninstaller path to stack
     215  ; Save current i8042prt info to new uninstall registry path.
     216  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
     217  WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}" $0
     218
     219  ; Try to wipe current installation directory.
     220  Push $1 ; Push uninstaller path to stack.
    170221  Call ${un}Uninstall_WipeInstallationDirectory
    171222  Pop $2  ; Get uninstaller exit code from stack
    172   StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit
     223  StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
    173224
    174225common:
    175226
    176   ; Make sure everything is cleaned up in case the old uninstaller did forget something
     227  ; Make sure everything is cleaned up in case the old uninstaller did forget something.
    177228  DeleteRegKey HKLM "SOFTWARE\Sun\VirtualBox Guest Additions"
    178229  DeleteRegKey /ifempty HKLM "SOFTWARE\Sun"
     
    182233  Delete /REBOOTOK "$1\PCNTPCI5.sys"
    183234
    184   ; Try to remove old installation directory if empty
     235  ; Try to remove old installation directory if empty.
    185236  RMDir /r /REBOOTOK "$SMPROGRAMS\Sun VirtualBox Guest Additions"
    186237  RMDir /REBOOTOK "$1"
    187238
    188   ; Get original mouse driver info and restore it
    189   ;ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH}
     239  ; Get original mouse driver info and restore it.
     240  ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
    190241  ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
    191242  ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
    192243
    193244  ; Delete vendor installation directory (only if completely empty)
    194 !if $%KBUILD_TARGET_ARCH% == "x86"       ; 32-bit
     245!if $%KBUILD_TARGET_ARCH% == "x86"
    195246  RMDir /REBOOTOK "$PROGRAMFILES32\Sun"
    196247!else   ; 64-bit
     
    208259!insertmacro Uninstall_Sun ""
    209260
    210 ; This function cleans up an old xVM Sun installation
     261
    211262!macro Uninstall_SunXVM un
     263;;
     264; Function to clean  up an old Sun xVM installation.
     265;
     266; Input:
     267;   None
     268; Output:
     269;   None
     270;
    212271Function ${un}Uninstall_SunXVM
    213272
     
    216275  Push $2
    217276
    218   ; Get current installation path
     277  ; Get current installation path.
    219278  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
     279  StrCmp $0 "" exit
     280
     281  ; Extract path.
     282  Push "$0"       ; String
     283  Push "\"        ; SubString
     284  Push "<"        ; SearchDirection
     285  Push "<"        ; StrInclusionDirection
     286  Push "0"        ; IncludeSubString
     287  Push "0"        ; Loops
     288  Push "0"        ; CaseSensitive
     289  Call ${un}StrStrAdv
     290  Pop $1          ; $1 only contains the full path
     291
     292  StrCmp $1 "" exit
     293
     294  ; Save current i8042prt info to new uninstall registry path.
     295  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" ${REGISTRY_VAL_ORG_MOUSE_PATH}
     296  WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" ${REGISTRY_VAL_ORG_MOUSE_PATH} $0
     297
     298  ; Try to wipe current installation directory.
     299  Push $1 ; Push uninstaller path to stack.
     300  Call ${un}Uninstall_WipeInstallationDirectory
     301  Pop $2  ; Get uninstaller exit code from stack.
     302  StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
     303
     304common:
     305
     306  ; Make sure everything is cleaned up in case the old uninstaller did forget something.
     307  DeleteRegKey HKLM "SOFTWARE\Sun\xVM VirtualBox Guest Additions"
     308  DeleteRegKey /ifempty HKLM "SOFTWARE\Sun"
     309  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions"
     310  Delete /REBOOTOK "$1\netamd.inf"
     311  Delete /REBOOTOK "$1\pcntpci5.cat"
     312  Delete /REBOOTOK "$1\PCNTPCI5.sys"
     313
     314  ; Try to remove old installation directory if empty.
     315  RMDir /r /REBOOTOK "$SMPROGRAMS\Sun xVM VirtualBox Guest Additions"
     316  RMDir /REBOOTOK "$1"
     317
     318  ; Delete vendor installation directory (only if completely empty).
     319!if $%KBUILD_TARGET_ARCH% == "x86"
     320  RMDir /REBOOTOK "$PROGRAMFILES32\Sun"
     321!else
     322  RMDir /REBOOTOK "$PROGRAMFILES64\Sun"
     323!endif
     324
     325  ; Get original mouse driver info and restore it.
     326  ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
     327  ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
     328  ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
     329
     330exit:
     331
     332  Pop $2
     333  Pop $1
     334  Pop $0
     335
     336FunctionEnd
     337!macroend
     338!insertmacro Uninstall_SunXVM ""
     339
     340
     341!macro Uninstall_Innotek un
     342;;
     343; Function to clean  up an old innotek installation.
     344;
     345; Input:
     346;   None
     347; Output:
     348;   None
     349;
     350Function ${un}Uninstall_Innotek
     351
     352  Push $0
     353  Push $1
     354  Push $2
     355
     356  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
    220357  StrCmp $0 "" exit
    221358
     
    233370  StrCmp $1 "" exit
    234371
    235   ; Save current i8042prt info to new uninstall registry path
    236   ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" ${ORG_MOUSE_PATH}
    237   WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH} $0
    238 
    239   ; Try to wipe current installation directory
    240   Push $1 ; Push uninstaller path to stack
     372  ; Save current i8042prt info to new uninstall registry path.
     373  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
     374  WriteRegStr HKLM "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}" $0
     375
     376  ; Try to wipe current installation directory.
     377  Push $1 ; Push uninstaller path to stack.
    241378  Call ${un}Uninstall_WipeInstallationDirectory
    242   Pop $2  ; Get uninstaller exit code from stack
    243   StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit
     379  Pop $2  ; Get uninstaller exit code from stack.
     380  StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit.
    244381
    245382common:
    246383
    247   ; Make sure everything is cleaned up in case the old uninstaller did forget something
    248   DeleteRegKey HKLM "SOFTWARE\Sun\xVM VirtualBox Guest Additions"
    249   DeleteRegKey /ifempty HKLM "SOFTWARE\Sun"
    250   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions"
    251   Delete /REBOOTOK "$1\netamd.inf"
    252   Delete /REBOOTOK "$1\pcntpci5.cat"
    253   Delete /REBOOTOK "$1\PCNTPCI5.sys"
    254 
    255   ; Try to remove old installation directory if empty
    256   RMDir /r /REBOOTOK "$SMPROGRAMS\Sun xVM VirtualBox Guest Additions"
    257   RMDir /REBOOTOK "$1"
    258 
    259   ; Delete vendor installation directory (only if completely empty)
    260 !if $%KBUILD_TARGET_ARCH% == "x86"       ; 32-bit
    261   RMDir /REBOOTOK "$PROGRAMFILES32\Sun"
    262 !else   ; 64-bit
    263   RMDir /REBOOTOK "$PROGRAMFILES64\Sun"
    264 !endif
    265 
    266   ; Get original mouse driver info and restore it
    267   ;ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH}
    268   ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
    269   ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
    270 
    271 exit:
    272 
    273   Pop $2
    274   Pop $1
    275   Pop $0
    276 
    277 FunctionEnd
    278 !macroend
    279 !insertmacro Uninstall_SunXVM ""
    280 
    281 ; This function cleans up an old innotek installation
    282 !macro Uninstall_Innotek un
    283 Function ${un}Uninstall_Innotek
    284 
    285   Push $0
    286   Push $1
    287   Push $2
    288 
    289   ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
    290   StrCmp $0 "" exit
    291 
    292   ; Extract path
    293   Push "$0"       ; String
    294   Push "\"        ; SubString
    295   Push "<"        ; SearchDirection
    296   Push "<"        ; StrInclusionDirection
    297   Push "0"        ; IncludeSubString
    298   Push "0"        ; Loops
    299   Push "0"        ; CaseSensitive
    300   Call ${un}StrStrAdv
    301   Pop $1          ; $1 only contains the full path
    302 
    303   StrCmp $1 "" exit
    304 
    305   ; Save current i8042prt info to new uninstall registry path
    306   ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" ${ORG_MOUSE_PATH}
    307   WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH} $0
    308 
    309   ; Try to wipe current installation directory
    310   Push $1 ; Push uninstaller path to stack
    311   Call ${un}Uninstall_WipeInstallationDirectory
    312   Pop $2  ; Get uninstaller exit code from stack
    313   StrCmp $2 0 common exit ; Only process common part if exit code is 0, otherwise exit
    314 
    315 common:
    316 
    317   ; Remove left over files which were not entirely cached by the formerly running
    318   ; uninstaller
     384  ; Remove left over files which were not entirely cached by the formerly running uninstaller.
    319385  DeleteRegKey HKLM "SOFTWARE\innotek\VirtualBox Guest Additions"
    320386  DeleteRegKey HKLM "SOFTWARE\innotek"
     
    343409  Delete /REBOOTOK "$1\VBoxVideo.sys"
    344410
    345   ; Try to remove old installation directory if empty
     411  ; Try to remove old installation directory if empty.
    346412  RMDir /r /REBOOTOK "$SMPROGRAMS\innotek VirtualBox Guest Additions"
    347413  RMDir /REBOOTOK "$1"
    348414
    349   ; Delete vendor installation directory (only if completely empty)
     415  ; Delete vendor installation directory (only if completely empty).
    350416!if $%KBUILD_TARGET_ARCH% == "x86"       ; 32-bit
    351417  RMDir /REBOOTOK "$PROGRAMFILES32\innotek"
     
    354420!endif
    355421
    356   ; Get original mouse driver info and restore it
    357   ;ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH}
     422  ; Get original mouse driver info and restore it.
     423  ;ReadRegStr $0 "${REGISTRY_KEY_UNINST_ROOT}" "${REGISTRY_KEY_UNINST_PRODUCT}" "${REGISTRY_VAL_ORG_MOUSE_PATH}"
    358424  ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0
    359   ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys"
     425  ;Delete "$SYSDIR\drivers\VBoxMouseNT.sys".
    360426
    361427exit:
     
    368434!macroend
    369435!insertmacro Uninstall_Innotek ""
     436
     437
     438;;
     439; Handles uninstallation of legacy Guest Additions and/or performs necessary migration steps.
     440;
     441; Input:
     442;   None
     443; Output:
     444;   None
     445;
     446Function HandleOldGuestAdditions
     447
     448  Push $0
     449  Push $1
     450  Push $2
     451
     452  ${LogVerbose} "Checking for old Guest Additions ..."
     453
     454  ; Check for old "Sun VirtualBox Guest Additions"
     455  ; - before rebranding to Oracle
     456  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
     457  ${If} $0 == ""
     458    goto sun_xvm_check ; If string is empty, Sun additions are probably not installed (anymore)
     459  ${EndIf}
     460
     461  MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_uninstall
     462    Pop $2
     463    Pop $1
     464    Pop $0
     465    MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
     466    Quit
     467
     468sun_uninstall:
     469
     470  Call Uninstall_Sun
     471  Goto migration_check
     472
     473sun_xvm_check:
     474
     475  ; Check for old "Sun xVM VirtualBox Guest Additions"
     476  ; - before getting rid of the "xVM" namespace
     477  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
     478  ${If} $0 == ""
     479    goto innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore).
     480  ${EndIf}
     481
     482  MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
     483    Pop $2
     484    Pop $1
     485    Pop $0
     486    MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
     487    Quit
     488
     489sun_xvm_uninstall:
     490
     491  Call Uninstall_SunXVM
     492  Goto migration_check
     493
     494innotek_check:
     495
     496  ; Check for old "innotek" Guest Additions" before rebranding to "Sun".
     497  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
     498  ${If} $0 == ""
     499    goto migration_check ; If string is empty, innotek Guest Additions are probably not installed (anymore).
     500  ${EndIf}
     501
     502  MessageBox MB_YESNO $(VBOX_INNOTEK_FOUND) /SD IDYES IDYES innotek_uninstall
     503    Pop $2
     504    Pop $1
     505    Pop $0
     506    MessageBox MB_ICONSTOP $(VBOX_INNOTEK_ABORTED) /SD IDOK
     507    Quit
     508
     509innotek_uninstall:
     510
     511  Call Uninstall_Innotek
     512  Goto migration_check
     513
     514migration_check:
     515
     516    ${If} $g_strAddVerMaj != ""
     517      goto migration_perform
     518    ${EndIf}
     519    goto done
     520
     521migration_perform:
     522
     523  ${LogVerbose} "Running migration steps ..."
     524
     525  ; Migrate old(er) installation directories (< 7.2) to new structure.
     526  Call Uninstall_Before7_2
     527
     528done:
     529
     530  Pop $2
     531  Pop $1
     532  Pop $0
     533
     534FunctionEnd
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette