VirtualBox

Ignore:
Timestamp:
Mar 18, 2011 11:02:24 AM (14 years ago)
Author:
vboxsync
Message:

Windows Guest Additions installer: Check if VBoxGINA already is installed and do an automated upgrade (whether /with_autologon is specified or not), put app mode (32-/64-bit) switching in own function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi

    r35833 r36311  
    535535FunctionEnd
    536536
    537 Function PrepareForUpdate
    538 
    539   StrCmp $g_strAddVerMaj "1" v1     ; Handle major version "v1.x"
    540   StrCmp $g_strAddVerMaj "2" v2     ; Handle major version "v2.x"
    541   StrCmp $g_strAddVerMaj "3" v3     ; Handle major version "v3.x"
    542   Goto exit
    543 
    544 v3:
    545 
    546   Goto exit
    547 
    548 v2:
    549 
    550   Goto exit
    551 
    552 v1:
    553 
    554   StrCmp $g_strAddVerMin "5" v1_5   ; Handle minor version "v1.5.x"
    555   StrCmp $g_strAddVerMin "6" v1_6   ; Handle minor version "v1.6.x"
    556 
    557 v1_5:
    558 
    559   Goto exit
    560 
    561 v1_6:
    562 
    563   Goto exit
    564 
    565 exit:
     537Function CheckForInstalledComponents
     538
     539  Push $0
     540
     541  DetailPrint "Checking for installed components ..."
     542
     543  Call SetAppMode64
     544
     545  ; VBoxGINA already installed? So we need to update the installed version as well,
     546  ; regardless whether the user used "/with_autologon" or not
     547  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
     548  ${If} $0 == "VBoxGINA.dll"
     549    DetailPrint "Found installed VBoxGINA"
     550    StrCpy $g_bWithAutoLogon "true"
     551  ${EndIf}
     552
     553  Pop $0
    566554
    567555FunctionEnd
     
    601589  SetOverwrite on
    602590
    603   ; Because this NSIS installer is always built in 32-bit mode, we have to
    604   ; do some tricks for the Windows paths
    605 !if $%BUILD_TARGET_ARCH% == "amd64"
    606   ; Because the next two lines will crash at the license page (??) we have to re-enable that here again
    607   ${DisableX64FSRedirection}
    608   SetRegView 64
    609 !endif
     591  Call SetAppMode64
    610592
    611593  StrCpy $g_strSystemDir "$SYSDIR"
    612594
    613595  Call EnableLog
    614   Call PrepareForUpdate
    615596
    616597  DetailPrint "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
     
    709690Section /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02
    710691
    711   ; Because this NSIS installer is always built in 32-bit mode, we have to
    712   ; do some tricks for the Windows paths
    713 !if $%BUILD_TARGET_ARCH% == "amd64"
    714   ; Because the next two lines will crash at the license page (??) we have to re-enable that here again
    715   ${DisableX64FSRedirection}
    716   SetRegView 64
    717 !endif
     692  Call SetAppMode64
    718693
    719694  Call GetWindowsVersion
     
    11391114  ${EndIf}
    11401115
     1116  Call CheckForInstalledComponents
     1117
    11411118  ; Set section bits
    11421119  ${If} $g_bWithAutoLogon == "true" ; Auto-logon support
     
    11561133!endif
    11571134
    1158   ; Because this NSIS installer is always built in 32-bit mode, we have to
    1159   ; do some tricks for the Windows paths for checking for old additions
    1160   ; in block below
    1161 !if $%BUILD_TARGET_ARCH% == "amd64"
    1162   ${DisableX64FSRedirection}
    1163   SetRegView 64
    1164 !endif
     1135  Call SetAppMode64
    11651136
    11661137  ; Check for old additions
     
    11711142  ; 64-bit registry view, so as a workaround switch back to 32-bit (Wow6432Node)
    11721143  ; mode for now
    1173 !if $%BUILD_TARGET_ARCH% == "amd64"
    1174   ${EnableX64FSRedirection}
    1175   SetRegView 32
    1176 !endif
     1144  Call SetAppMode32
    11771145
    11781146!endif ; UNINSTALLER_ONLY
     
    12091177proceed:
    12101178
    1211   ; Because this NSIS installer is always built in 32-bit mode, we have to
    1212   ; do some tricks for the Windows paths
    1213 !if $%BUILD_TARGET_ARCH% == "amd64"
    1214   ${DisableX64FSRedirection}
    1215   SetRegView 64
    1216 !endif
     1179  Call un.SetAppMode64
    12171180
    12181181  ; Set system directory
     
    12341197!endif
    12351198
    1236   ; Because this NSIS installer is always built in 32-bit mode, we have to
    1237   ; do some tricks for the Windows paths
    1238 !if $%BUILD_TARGET_ARCH% == "amd64"
    1239   ; Do *not* add this line in .onInit - it will crash at the license page (??) because of a weird NSIS bug
    1240   ${DisableX64FSRedirection}
    1241   SetRegView 64
    1242 !endif
     1199  Call un.SetAppMode64
    12431200
    12441201  ; Call the uninstall main function
Note: See TracChangeset for help on using the changeset viewer.

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