VirtualBox

Changeset 39558 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 8, 2011 3:02:48 PM (13 years ago)
Author:
vboxsync
Message:

Windows Guest Additions installer: Check for invalid/corrupted D3D files.

Location:
trunk/src/VBox/Additions/WINNT/Installer
Files:
6 edited

Legend:

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

    r37342 r39558  
    3030LangString VBOX_COMPONENT_D3D_OR_WDDM ${LANG_ENGLISH}               "This system supports the Windows Aero (WDDM) interface.$\r$\nVirtualBox support for this feature is experimental and should not be used on production systems yet.$\r$\n$\r$\nWould you like to install basic Direct3D support instead?"
    3131LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_ENGLISH}             "Please note that in order to use 3D acceleration the virtual machine requires at least 128 MB of video memory with 256 MB recommended if you wish to use it with multiple monitors.$\r$\n$\r$\nIf necessary you can change the video memory size in the $\"Display$\" section of the virtual machine settings."
     32LangString VBOX_COMPONENT_D3D_INVALID_WDDM ${LANG_ENGLISH}          "The setup detected a corrupt/invalid DirectX installation and cannot continue.$\r$\n$\r$\nIn order to get Direct3D support working, please re-install the DirectX runtime first.$\r$\n$\r$\nThis setup will abort now."
     33LangString VBOX_COMPONENT_D3D_INVALID_XPDM ${LANG_ENGLISH}          "The setup detected a corrupt/invalid DirectX installation.$\r$\n$\r$\nIn order to get Direct3D support working, re-installing the DirectX runtime first is highly recommended.$\r$\n$\r$\nContinue anyway?"
    3234
    3335LangString VBOX_WFP_WARN_REPLACE ${LANG_ENGLISH}         "In order to make ${PRODUCT_NAME} work correctly some system files have been replaced.$\r$\nIf the Windows File Protection service offers to restore the original files you should cancel the request to retain the newly installed functionality."
  • trunk/src/VBox/Additions/WINNT/Installer/Languages/French.nsh

    r37342 r39558  
    3030LangString VBOX_COMPONENT_D3D_OR_WDDM ${LANG_FRENCH}                "Ce système supporte l'interface Windows Aero (WDDM).$\r$\nLe support VirtualBox pour cette fonctionalité est expérimental et ne devrait pas encore être utilisé sur des systèmes importants.$\r$\n$\r$\nVoulez-vous installer le support Direct3D de base à la place?"
    3131LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_FRENCH}              "Veuillez noter que l'utilisation de l'accélération 3D nécécssite au moins 128 MB de mémoire vidéo ; pour un utilisation avec plusieurs écrans nous recommandons  d'affecter 256 MB.$\r$\n$\r$\nSi nécéssaire vous pouvez changer la taille du mémoire vidéo dans la sous-section $\"Affichage$\" des paramètres de la machine virtuelle."
     32LangString VBOX_COMPONENT_D3D_INVALID_WDDM ${LANG_FRENCH}           "The setup detected a corrupt/invalid DirectX installation and cannot continue.$\r$\n$\r$\nIn order to get Direct3D support working, please re-install the DirectX runtime first.$\r$\n$\r$\nThis setup will abort now."
     33LangString VBOX_COMPONENT_D3D_INVALID_XPDM ${LANG_FRENCH}           "The setup detected a corrupt/invalid DirectX installation.$\r$\n$\r$\nIn order to get Direct3D support working, re-installing the DirectX runtime first is highly recommended.$\r$\n$\r$\nContinue anyway?"
    3234
    3335LangString VBOX_WFP_WARN_REPLACE ${LANG_FRENCH}          "Le programme d'installation vient de remplacer certains fichiers systèmes afin de faire fonctionner correctement ${PRODUCT_NAME}.$\r$\nPour le cas qu'un avertissement de la Protection de fichiers Windows apparaisse, veuiller l'annuler sans restaurer les fichiers originaux!"
  • trunk/src/VBox/Additions/WINNT/Installer/Languages/German.nsh

    r37342 r39558  
    3030LangString VBOX_COMPONENT_D3D_OR_WDDM ${LANG_GERMAN}                "Für diesen Gast ist Windows Aero (WDDM)-Unterstützung verfügbar.$\r$\nDieses Feature ist jedoch noch experimentell und sollte daher noch nicht auf produktiven Systemen eingesetzt werden.$\r$\n$\r$\nMöchten Sie stattdessen die reguläre Direct3D-Unterstützung installieren?"
    3131LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_GERMAN}              "Bitte beachten Sie, dass die virtuelle Maschine für die Benutzung von 3D-Beschleunigung einen Grafikspeicher von mindestens 128 MB für einen Monitor benötigt und für den Multi-Monitor-Betrieb bis zu 256 MB empfohlen wird.$\r$\n$\r$\nSie können den Grafikspeicher in den VM-Einstellungen in der Kategorie $\"Anzeige$\" ändern."
     32LangString VBOX_COMPONENT_D3D_INVALID_WDDM ${LANG_GERMAN}           "Das Setup hat eine ungültige/beschädigte DirectX-Installation festgestellt und kann nicht fortfahren.$\r$\n$\r$\nUm die Direct3D-Unterstützung installieren zu können, muss die DirectX-Runtime neu installiert werden.$\r$\n$\r$\nDas Setup wird nun beendet."
     33LangString VBOX_COMPONENT_D3D_INVALID_XPDM ${LANG_GERMAN}           "Das Setup hat eine ungültige/beschädigte DirectX-Installation festgestellt.$\r$\n$\r$\nUm die Direct3D-Unterstützung installieren zu können wird empfohlen, zuerst die DirectX-Runtime neu zu installieren.$\r$\n$\r$\nMit der Installation jetzt trotzdem fortfahren?"
    3234
    3335LangString VBOX_WFP_WARN_REPLACE ${LANG_GERMAN}         "Das Setup hat gerade Systemdateien ersetzt um die ${PRODUCT_NAME} korrekt installieren zu können.$\r$\nFalls nun ein Warn-Dialog des Windows-Dateischutzes erscheint, diesen bitte abbrechen und die Dateien nicht wiederherstellen lassen!"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi

    r39549 r39558  
    558558FunctionEnd
    559559
    560 Function Common_CopyFiles
    561 
    562   SetOutPath "$INSTDIR"
    563   SetOverwrite on
    564 
    565 !ifdef VBOX_WITH_LICENSE_INSTALL_RTF
    566   ; Copy license file (if any) into the installation directory
    567   FILE "/oname=${LICENSE_FILE_RTF}" "$%VBOX_BRAND_LICENSE_RTF%"
    568 !endif
    569 
    570   FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
    571   FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
    572 
    573   FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
    574 !ifdef VBOX_SIGN_ADDITIONS
    575   FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
    576 !endif
    577 
    578   FILE "iexplore.ico"
    579 
    580 FunctionEnd
    581 
    582560; Main Files
    583561Section $(VBOX_COMPONENT_MAIN) SEC01
     
    614592  DetailPrint "Debug!"
    615593!endif
     594
     595  ;
     596  ; Here starts the main dispatcher (based on guest OS)
     597  ;
    616598
    617599  ; Which OS are we using?
     
    652634!endif
    653635
    654 vista: ; Windows Vista / Windows 7 / Windows 8
     636w2k: ; Windows 2000 and XP ...
    655637
    656638  ; Copy some common files ...
    657639  Call Common_CopyFiles
    658640
     641  Call W2K_Main
     642  goto success
     643
     644vista: ; Windows Vista / Windows 7 / Windows 8
     645
     646  ; Check requirments; this function can abort the installation if necessary!
     647  Call Vista_CheckForRequirements
     648
     649  ; Copy some common files ...
     650  Call Common_CopyFiles
     651
    659652  Call W2K_Main     ; First install stuff from Windows 2000 / XP
    660653  Call Vista_Main   ; ... and some specific stuff for Vista / Windows 7
    661   goto success
    662 
    663 w2k: ; Windows 2000 and XP ...
    664 
    665   ; Copy some common files ...
    666   Call Common_CopyFiles
    667 
    668   Call W2K_Main
    669654  goto success
    670655
     
    974959  SectionGetFlags ${SEC03} $0
    975960  ${If} $0 == ${SF_SELECTED}
     961
     962    StrCpy $g_bWithD3D "true"
    976963
    977964!if $%VBOX_WITH_WDDM% == "1"
     
    995982d3d_install:
    996983
    997 !endif
     984!endif ; $%VBOX_WITH_WDDM% == "1"
    998985
    999986    ${If} $g_bForceInstall != "true"
     
    10161003    ${EndIf}
    10171004
    1018     ; Validate D3D files
    1019     Call ValidateD3DFiles
    1020     Pop $0
    1021     ${If} $0 == "1"
    1022       MessageBox MB_ICONINFORMATION|MB_OK "D3D files invalid!" /SD IDOK
    1023       Goto d3d_disable
    1024     ${EndIf}
    1025 
    10261005  ${Else} ; D3D unselected again
     1006
    10271007    ${If} $g_strWinVersion != "8" ; On Windows 8 WDDM is mandatory
    10281008      StrCpy $g_bWithWDDM "false"
    10291009    ${EndIf}
     1010
    10301011  ${EndIf}
    10311012  Goto exit
     
    10331014d3d_disable:
    10341015
     1016  StrCpy $g_bWithD3D "false"
    10351017  IntOp $0 $0 & ${SECTION_OFF} ; Unselect section again
    10361018  SectionSetFlags ${SEC03} $0
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r39549 r39558  
    1515; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616;
     17
     18Function Common_CopyFiles
     19
     20  SetOutPath "$INSTDIR"
     21  SetOverwrite on
     22
     23!ifdef VBOX_WITH_LICENSE_INSTALL_RTF
     24  ; Copy license file (if any) into the installation directory
     25  FILE "/oname=${LICENSE_FILE_RTF}" "$%VBOX_BRAND_LICENSE_RTF%"
     26!endif
     27
     28  FILE "$%VBOX_PATH_DIFX%\DIFxAPI.dll"
     29  FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
     30
     31  FILE "$%PATH_OUT%\bin\additions\VBoxVideo.inf"
     32!ifdef VBOX_SIGN_ADDITIONS
     33  FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
     34!endif
     35
     36  FILE "iexplore.ico"
     37
     38FunctionEnd
    1739
    1840!ifndef UNINSTALLER_ONLY
     
    655677; Verifies a given file by checking its file vendor and target
    656678; architecture.
    657 ; @return  Stack: "0" if verify, "1" if not, "2" on error / not found.
     679; @return  Stack: "0" if valid, "1" if not, "2" on error / not found.
    658680; @param   Stack: Architecture ("x86" or "amd64").
    659681; @param   Stack: Vendor.
     
    672694  Push $3 ;               S: old$3 old$2 old$1 old$0
    673695
    674 MessageBox MB_ICONSTOP "Vendor $1" /SD IDOK
    675696  IfFileExists "$0" check_vendor
    676697  Goto not_found
     
    681702  Call ${un}GetFileVendor
    682703  Pop $3
    683 MessageBox MB_ICONSTOP "$3 vs. $1" /SD IDOK
     704
    684705  ${If} $3 == $1
    685706    Goto check_arch
     
    693714  Call ${un}GetFileArchitecture
    694715  Pop $3
    695 MessageBox MB_ICONSTOP "$3 vs. $2" /SD IDOK
     716
    696717  ${If} $3 == $2
    697718    StrCpy $3 "0" ; Valid
     
    707728
    708729end:
    709 MessageBox MB_ICONSTOP "Res: $3" /SD IDOK
     730
    710731  ; S: old$3 old$2 old$1 old$0
    711732  Exch $3 ; S: $3 old$2 old$1 old$0
     
    722743!insertmacro VerifyFile "un."
    723744
     745;
     746; Macro for accessing VerifyFile in a more convenient way by using
     747; a parameter list.
     748; @return  Stack: "0" if valid, "1" if not, "2" on error / not found.
     749; @param   Un/Installer prefix; either "" or "un".
     750; @param   Name of file to verify.
     751; @param   Vendor to check for.
     752; @param   Architecture ("x86" or "amd64") to check for.
     753;
    724754!macro VerifyFileEx un File Vendor Architecture
    725755  Push "${Architecture}"
     
    731761
    732762;
    733 ; Validates backed up original Direct3D files.
     763; Validates backed up and replaced Direct3D files; either the d3d*.dll have
     764; to be from Microsoft or the (already) backed up msd3d*.dll files. If both
     765; don't match we have a corrupted / invalid installation.
    734766; @return  Stack: "0" if files are valid; otherwise "1".
    735767;
     
    737769Function ${un}ValidateD3DFiles
    738770
    739   ; TODO: Here comes the check
    740   ${VerifyFileEx} "${un}" "$SYSDIR\foo.dll" "Microsoft Corporation" "x86"
     771  Push $0
     772
     773  ; We need to switch to 64-bit app mode to handle the "real" 64-bit files in
     774  ; ""system32" on a 64-bit guest
     775  Call ${un}SetAppMode64
     776
     777  ; Note: Not finding a file (like *d3d8.dll) on Windows Vista/7 is fine;
     778  ;       it simply is not present there.
     779
     780  ${VerifyFileEx} "${un}" "$SYSDIR\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     781  Pop $0
     782  ${If} $0 == "1"
     783    Goto verify_msd3d
     784  ${EndIf}
     785  ${VerifyFileEx} "${un}" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     786  Pop $0
     787  ${If} $0 == "1"
     788    Goto verify_msd3d
     789  ${EndIf}
     790
     791  ${VerifyFileEx} "${un}" "$SYSDIR\dllcache\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     792  Pop $0
     793  ${If} $0 == "1"
     794    Goto verify_msd3d
     795  ${EndIf}
     796  ${VerifyFileEx} "${un}" "$SYSDIR\dllcache\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     797  Pop $0
     798  ${If} $0 == "1"
     799    Goto verify_msd3d
     800  ${EndIf}
     801
     802!if $%BUILD_TARGET_ARCH% == "amd64"
     803
     804  ${VerifyFileEx} "${un}" "$g_strSysWow64\d3d8.dll" "Microsoft Corporation" "x86"
     805  Pop $0
     806  ${If} $0 == "1"
     807    Goto verify_msd3d
     808  ${EndIf}
     809  ${VerifyFileEx} "${un}" "$g_strSysWow64\d3d9.dll" "Microsoft Corporation" "x86"
     810  Pop $0
     811  ${If} $0 == "1"
     812    Goto verify_msd3d
     813  ${EndIf}
     814
     815  ${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\d3d8.dll" "Microsoft Corporation" "x86"
     816  Pop $0
     817  ${If} $0 == "1"
     818    Goto verify_msd3d
     819  ${EndIf}
     820  ${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\d3d9.dll" "Microsoft Corporation" "x86"
     821  Pop $0
     822  ${If} $0 == "1"
     823    Goto verify_msd3d
     824  ${EndIf}
     825
     826!endif
     827
     828  Goto valid
     829
     830verify_msd3d:
     831
     832  ${VerifyFileEx} "${un}" "$SYSDIR\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     833  Pop $0
     834  ${If} $0 == "1"
     835    Goto invalid
     836  ${EndIf}
     837  ${VerifyFileEx} "${un}" "$SYSDIR\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     838  Pop $0
     839  ${If} $0 == "1"
     840    Goto invalid
     841  ${EndIf}
     842
     843  ${VerifyFileEx} "${un}" "$SYSDIR\dllcache\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     844  Pop $0
     845  ${If} $0 == "1"
     846    Goto invalid
     847  ${EndIf}
     848  ${VerifyFileEx} "${un}" "$SYSDIR\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
     849  Pop $0
     850  ${If} $0 == "1"
     851    Goto invalid
     852  ${EndIf}
     853
     854!if $%BUILD_TARGET_ARCH% == "amd64"
     855
     856  ${VerifyFileEx} "${un}" "$g_strSysWow64\msd3d8.dll" "Microsoft Corporation" "x86"
     857  Pop $0
     858  ${If} $0 == "1"
     859    Goto invalid
     860  ${EndIf}
     861  ${VerifyFileEx} "${un}" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86"
     862  Pop $0
     863  ${If} $0 == "1"
     864    Goto invalid
     865  ${EndIf}
     866
     867  ${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d8.dll" "Microsoft Corporation" "x86"
     868  Pop $0
     869  ${If} $0 == "1"
     870    Goto invalid
     871  ${EndIf}
     872  ${VerifyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86"
     873  Pop $0
     874  ${If} $0 == "1"
     875    Goto invalid
     876  ${EndIf}
     877
     878!endif
     879
     880  Goto valid
     881
     882valid:
     883
     884  StrCpy $0 "0" ; Installation valid
     885  Goto end
     886
     887invalid:
     888
     889  StrCpy $0 "1" ; Installation invalid / corrupted
     890  Goto end
    741891
    742892end:
     893
     894  Exch $0
    743895
    744896FunctionEnd
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsVista.nsh

    r38760 r39558  
    1515; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616;
     17
     18Function Vista_CheckForRequirements
     19
     20  Push $0
     21
     22  DetailPrint "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..."
     23
     24  ${If} $g_bForceInstall == "true"
     25    DetailPrint "Forcing installatoin, checking requirements skipped"
     26    goto success
     27  ${EndIf}
     28
     29  ${If} $g_bWithD3D == "true"
     30    ; Validate D3D files
     31    Call ValidateD3DFiles
     32    Pop $0
     33    ${If} $0 == "1" ; D3D files are invalid
     34      ${If} $g_bWithWDDM == "true"
     35        MessageBox MB_ICONSTOP|MB_OK $(VBOX_COMPONENT_D3D_INVALID_WDDM) /SD IDOK
     36        goto failure
     37      ${Else}
     38        MessageBox MB_ICONSTOP|MB_OKCANCEL $(VBOX_COMPONENT_D3D_INVALID_XPDM) /SD IDCANCEL IDCANCEL failure
     39      ${EndIf}
     40    ${EndIf}
     41  ${EndIf}
     42
     43  Goto success
     44
     45failure:
     46
     47  Abort "ERROR: Requirements not met! Installation aborted."
     48  goto exit
     49
     50success:
     51
     52  ; Nothing to do here right now
     53  Goto exit
     54
     55exit:
     56
     57  Pop $0
     58
     59FunctionEnd
    1760
    1861Function Vista_CopyFiles
     
    3982
    4083error:
    41   Abort "ERROR: Could not install files for Vista / Windows 7 / Windows 8! Installation aborted."
     84
     85  Abort "ERROR: Could not install files! Installation aborted."
    4286
    4387done:
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