VirtualBox

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


Ignore:
Timestamp:
Dec 8, 2011 4:42:22 PM (13 years ago)
Author:
vboxsync
Message:

Windows Guest Additions installer: Only install D3D DLL cache files if needed, use more LogicLib stuff.

File:
1 edited

Legend:

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

    r39558 r39561  
    726726  Pop $0
    727727
    728   IfFileExists "$0" +3 +1
     728  ${IfNot} ${FileExists} "$0"
    729729    LogText "WRP: File $0 does not exist, skipping"
    730730    Return
    731 
    732   IfFileExists "$g_strSystemDir\takeown.exe" +1 +4
     731  ${EndIf}
     732
     733  ${If} ${FileExists} "$g_strSystemDir\takeown.exe"
    733734    nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"'
    734735    Pop $1 ; Ret value
    735736    LogText "WRP: Taking ownership for $0 returned: $1"
     737  ${Else}
     738    LogText "WRP: Warning: takeown.exe not found, skipping"
     739  ${EndIf}
    736740
    737741  AccessControl::SetFileOwner "$0" "(S-1-5-32-545)"
     
    778782  FILE "$%PATH_OUT%\bin\additions\wined3d.dll"
    779783
     784  ;
    780785  ; Update DLL cache
    781   SetOutPath "$g_strSystemDir\dllcache"
    782   IfFileExists "$g_strSystemDir\dllcache\msd3d8.dll" +2
    783     CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll"
    784   IfFileExists "$g_strSystemDir\dllcache\msd3d9.dll" +2
    785     CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll"
    786 
    787   Push "$g_strSystemDir\dllcache\d3d8.dll"
    788   Call PrepareWRPFile
    789 
    790   Push "$g_strSystemDir\dllcache\d3d9.dll"
    791   Call PrepareWRPFile
    792 
    793   ; Exchange DLLs
    794   !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
    795   !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
    796 
    797   ; If exchange above failed, do it on reboot
    798   !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
    799   !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
    800 
     786  ;
     787  ${If} ${FileExists} "$g_strSystemDir\dllcache"
     788    SetOutPath "$g_strSystemDir\dllcache"
     789    ${IfNot} ${FileExists} "$g_strSystemDir\dllcache\msd3d8.dll"
     790      CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll"
     791    ${EndIf}
     792    ${IfNot} ${FileExists} "$g_strSystemDir\dllcache\msd3d9.dll"
     793      CopyFiles /SILENT "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll"
     794    ${EndIf}
     795
     796    Push "$g_strSystemDir\dllcache\d3d8.dll"
     797    Call PrepareWRPFile
     798
     799    Push "$g_strSystemDir\dllcache\d3d9.dll"
     800    Call PrepareWRPFile
     801
     802    ; Exchange DLLs
     803    !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
     804    !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
     805
     806    ; If exchange above failed, do it on reboot
     807    !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP"
     808    !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP"
     809  ${Else}
     810      DetailPrint "DLL cache does not exist, skipping"
     811  ${EndIf}
     812
     813  ;
    801814  ; Save original DLLs (only if msd3d*.dll does not exist) ...
     815  ;
    802816  SetOutPath $g_strSystemDir
    803   IfFileExists "$g_strSystemDir\msd3d8.dll" +2
     817  ${IfNot} ${FileExists} "$g_strSystemDir\msd3d8.dll"
    804818    CopyFiles /SILENT "$g_strSystemDir\d3d8.dll" "$g_strSystemDir\msd3d8.dll"
    805   IfFileExists "$g_strSystemDir\msd3d9.dll" +2
     819  ${EndIf}
     820  ${IfNot} ${FileExists} "$g_strSystemDir\msd3d9.dll"
    806821    CopyFiles /SILENT "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll"
     822  ${EndIf}
    807823
    808824  Push "$g_strSystemDir\d3d8.dll"
     
    820836  !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP"
    821837
    822   !if $%BUILD_TARGET_ARCH% == "amd64"
     838!if $%BUILD_TARGET_ARCH% == "amd64"
    823839    ; Only 64-bit installer:
    824840    ; Also copy 32-bit DLLs on 64-bit Windows in SysWOW64 node
     
    833849    ; Update DLL cache
    834850    ;
    835 
    836     ; Save original DLLs (only if msd3d*.dll does not exist) ...
    837     SetOutPath "$g_strSysWow64\dllcache"
    838     IfFileExists "$g_strSysWow64\dllcache\msd3d8.dll" +2
    839       CopyFiles /SILENT "$g_strSysWow64\dllcache\d3d8.dll" "$g_strSysWow64\dllcache\msd3d8.dll"
    840     IfFileExists "$g_strSysWow64\dllcache\msd3d9.dll" +2
    841       CopyFiles /SILENT "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll"
    842 
    843     Push "$g_strSysWow64\dllcache\d3d8.dll"
    844     Call PrepareWRPFile
    845 
    846     Push "$g_strSysWow64\dllcache\d3d9.dll"
    847     Call PrepareWRPFile
    848 
    849     ; Exchange DLLs
    850     !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
    851     !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
    852 
    853     ; If exchange above failed, do it on reboot
    854     !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
    855     !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
     851    ${If} ${FileExists} "$g_strSysWow64\dllcache"
     852      SetOutPath "$g_strSysWow64\dllcache"
     853      ${IfNot} ${FileExists} "$g_strSysWow64\dllcache\msd3d8.dll"
     854        CopyFiles /SILENT "$g_strSysWow64\dllcache\d3d8.dll" "$g_strSysWow64\dllcache\msd3d8.dll"
     855      ${EndIf}
     856      ${IfNot} ${FileExists} "$g_strSysWow64\dllcache\msd3d9.dll"
     857        CopyFiles /SILENT "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll"
     858      ${EndIf}
     859
     860      Push "$g_strSysWow64\dllcache\d3d8.dll"
     861      Call PrepareWRPFile
     862
     863      Push "$g_strSysWow64\dllcache\d3d9.dll"
     864      Call PrepareWRPFile
     865
     866      ; Exchange DLLs
     867      !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
     868      !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
     869
     870      ; If exchange above failed, do it on reboot
     871      !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP"
     872      !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP"
     873    ${Else}
     874      DetailPrint "DLL cache does not exist, skipping"
     875    ${EndIf}
    856876
    857877    ;
     
    860880
    861881    ; Save original DLLs (only if msd3d*.dll does not exist) ...
    862     IfFileExists "$g_strSysWow64\msd3d8.dll" +2
     882    ${IfNot} ${FileExists} "$g_strSysWow64\msd3d8.dll"
    863883      CopyFiles /SILENT "$g_strSysWow64\d3d8.dll" "$g_strSysWow64\msd3d8.dll"
    864     IfFileExists "$g_strSysWow64\msd3d9.dll" +2
     884    ${EndIf}
     885    ${IfNot} ${FileExists} "$g_strSysWow64\msd3d9.dll"
    865886      CopyFiles /SILENT "$g_strSysWow64\d3d9.dll" "$g_strSysWow64\msd3d9.dll"
     887    ${EndIf}
    866888
    867889    Push "$g_strSysWow64\d3d8.dll"
     
    879901    !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\d3d9.dll" "$TEMP"
    880902
    881   !endif ; amd64
     903!endif ; amd64
    882904  Goto done
    883905
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