VirtualBox

Ignore:
Timestamp:
Feb 12, 2014 11:12:01 AM (11 years ago)
Author:
vboxsync
Message:

Windows Guest Additions installer: Remove Windows Resource Protection (WRP) before restoring D3D system files.

File:
1 edited

Legend:

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

    r50401 r50421  
    787787SectionEnd
    788788
    789 ; Prepares the access rights for replacing
    790 ; a WRP (Windows Resource Protection) protected file
    791 Function PrepareWRPFile
    792 
    793   Pop $0
    794 
    795   ${IfNot} ${FileExists} "$0"
    796     ${LogVerbose} "WRP: File $0 does not exist, skipping"
    797     Return
    798   ${EndIf}
    799 
    800   ${If} ${FileExists} "$g_strSystemDir\takeown.exe"
    801     ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true"
    802   ${Else}
    803     ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping"
    804   ${EndIf}
    805 
    806   AccessControl::SetFileOwner "$0" "(S-1-5-32-545)"
    807   Pop $1
    808   ${LogVerbose} "WRP: Setting file owner for $0 returned: $1"
    809 
    810   AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"
    811   Pop $1
    812   ${LogVerbose} "WRP: Setting access rights for $0 returned: $1"
    813 
    814 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
    815   !ifdef WFP_FILE_EXCEPTION
    816     VBoxGuestInstallHelper::DisableWFP "$0"
    817     Pop $1 ; Get return value (ignored for now)
    818     ${LogVerbose} "WRP: Setting WFP exception for $0 returned: $1"
    819   !endif
    820 !endif
    821 
    822 FunctionEnd
    823 
    824789; Direct3D support
    825790Section /o $(VBOX_COMPONENT_D3D) SEC03
     
    827792!if $%VBOX_WITH_WDDM% == "1"
    828793  ${If} $g_bWithWDDM == "true"
     794    ${LogVerbose} "Installing WDDM Direct3D support ..."
     795
    829796    ; Do we need to restore the original d3d8.dll/d3d9.dll files because the guest
    830797    ; installation was upgraded from XPDM to WDDM driver? In a XPDM installation
     
    835802!endif
    836803
     804  Call SetAppMode64
    837805  SetOverwrite on
    838806
     
    842810
    843811  SetOutPath $g_strSystemDir
    844   ${LogVerbose} "Installing Direct3D support ..."
     812  ${LogVerbose} "Installing XPDM Direct3D support ..."
    845813  FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
    846814  FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
     
    856824      ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
    857825
    858       Push "$g_strSystemDir\dllcache\d3d8.dll"
    859       Call PrepareWRPFile
    860 
    861       Push "$g_strSystemDir\dllcache\d3d9.dll"
    862       Call PrepareWRPFile
    863 
    864826      ; Exchange DLLs
     827      ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d8.dll"
    865828      ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
     829      ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll"
    866830      ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
    867831    ${Else}
     
    877841  ${CopyFileEx} "" "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%"
    878842
    879   Push "$g_strSystemDir\d3d8.dll"
    880   Call PrepareWRPFile
    881 
    882   Push "$g_strSystemDir\d3d9.dll"
    883   Call PrepareWRPFile
    884 
    885843  ; Exchange DLLs
     844  ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d8.dll"
    886845  ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP"
     846  ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d9.dll"
    887847  ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
    888848
     
    905865        ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86"
    906866
    907         Push "$g_strSysWow64\dllcache\d3d8.dll"
    908         Call PrepareWRPFile
    909 
    910         Push "$g_strSysWow64\dllcache\d3d9.dll"
    911         Call PrepareWRPFile
    912 
    913867        ; Exchange DLLs
     868        ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d8.dll"
    914869        ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
     870        ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll"
    915871        ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
    916872      ${Else}
     
    927883    ${CopyFileEx} "" "$g_strSysWow64\d3d9.dll" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86"
    928884
    929     Push "$g_strSysWow64\d3d8.dll"
    930     Call PrepareWRPFile
    931 
    932     Push "$g_strSysWow64\d3d9.dll"
    933     Call PrepareWRPFile
    934 
    935     ; Exchange DLLs
     885    ${PrepareWRPFileEx} "" "$g_strSysWow64\d3d8.dll"
    936886    ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\d3d8.dll" "$TEMP"
     887    ${PrepareWRPFileEx} "" "$g_strSysWow64\d3d9.dll"
    937888    ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\d3d9.dll" "$TEMP"
    938889
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