Changeset 50421 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 12, 2014 11:12:01 AM (11 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Installer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi
r50401 r50421 787 787 SectionEnd 788 788 789 ; Prepares the access rights for replacing790 ; a WRP (Windows Resource Protection) protected file791 Function PrepareWRPFile792 793 Pop $0794 795 ${IfNot} ${FileExists} "$0"796 ${LogVerbose} "WRP: File $0 does not exist, skipping"797 Return798 ${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 $1808 ${LogVerbose} "WRP: Setting file owner for $0 returned: $1"809 810 AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"811 Pop $1812 ${LogVerbose} "WRP: Setting access rights for $0 returned: $1"813 814 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"815 !ifdef WFP_FILE_EXCEPTION816 VBoxGuestInstallHelper::DisableWFP "$0"817 Pop $1 ; Get return value (ignored for now)818 ${LogVerbose} "WRP: Setting WFP exception for $0 returned: $1"819 !endif820 !endif821 822 FunctionEnd823 824 789 ; Direct3D support 825 790 Section /o $(VBOX_COMPONENT_D3D) SEC03 … … 827 792 !if $%VBOX_WITH_WDDM% == "1" 828 793 ${If} $g_bWithWDDM == "true" 794 ${LogVerbose} "Installing WDDM Direct3D support ..." 795 829 796 ; Do we need to restore the original d3d8.dll/d3d9.dll files because the guest 830 797 ; installation was upgraded from XPDM to WDDM driver? In a XPDM installation … … 835 802 !endif 836 803 804 Call SetAppMode64 837 805 SetOverwrite on 838 806 … … 842 810 843 811 SetOutPath $g_strSystemDir 844 ${LogVerbose} "Installing Direct3D support ..."812 ${LogVerbose} "Installing XPDM Direct3D support ..." 845 813 FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll" 846 814 FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll" … … 856 824 ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 857 825 858 Push "$g_strSystemDir\dllcache\d3d8.dll"859 Call PrepareWRPFile860 861 Push "$g_strSystemDir\dllcache\d3d9.dll"862 Call PrepareWRPFile863 864 826 ; Exchange DLLs 827 ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d8.dll" 865 828 ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP" 829 ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" 866 830 ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP" 867 831 ${Else} … … 877 841 ${CopyFileEx} "" "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 878 842 879 Push "$g_strSystemDir\d3d8.dll"880 Call PrepareWRPFile881 882 Push "$g_strSystemDir\d3d9.dll"883 Call PrepareWRPFile884 885 843 ; Exchange DLLs 844 ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d8.dll" 886 845 ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP" 846 ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d9.dll" 887 847 ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP" 888 848 … … 905 865 ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86" 906 866 907 Push "$g_strSysWow64\dllcache\d3d8.dll"908 Call PrepareWRPFile909 910 Push "$g_strSysWow64\dllcache\d3d9.dll"911 Call PrepareWRPFile912 913 867 ; Exchange DLLs 868 ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d8.dll" 914 869 ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP" 870 ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" 915 871 ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP" 916 872 ${Else} … … 927 883 ${CopyFileEx} "" "$g_strSysWow64\d3d9.dll" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86" 928 884 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" 936 886 ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\d3d8.dll" "$TEMP" 887 ${PrepareWRPFileEx} "" "$g_strSysWow64\d3d9.dll" 937 888 ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\d3d9.dll" "$TEMP" 938 889 -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh
r50414 r50421 823 823 ; @return Stack: "0" if copied, "1" if not, "2" on error / not found. 824 824 ; @param Un/Installer prefix; either "" or "un". 825 ; @param Name of lib/DLL to verify andcopy to destination.826 ; @param Destination name to copy verifiedfile to.825 ; @param Name of lib/DLL to copy to destination. 826 ; @param Destination name to copy the source file to. 827 827 ; @param Temporary folder used for exchanging the (locked) lib/DLL after a reboot. 828 828 ; … … 1041 1041 ; in SysWOW64 (or in system32 on 32-bit systems). 1042 1042 1043 ${LogVerbose} "Restoring original D3D files ..." 1043 1044 !if $%BUILD_TARGET_ARCH% == "x86" 1045 $PrepareWRPFileEx} "${un}" "$SYSDIR\d3d8.dll" 1044 1046 ${CopyFileEx} "${un}" "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 1045 1047 !endif 1048 $PrepareWRPFileEx} "${un}" "$SYSDIR\d3d9.dll" 1046 1049 ${CopyFileEx} "${un}" "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 1047 1050 1048 1051 ${If} $g_bCapDllCache == "true" 1049 1052 !if $%BUILD_TARGET_ARCH% == "x86" 1053 $PrepareWRPFileEx} "${un}" "$SYSDIR\dllcache\d3d8.dll" 1050 1054 ${CopyFileEx} "${un}" "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 1051 1055 !endif 1056 $PrepareWRPFileEx} "${un}" "$SYSDIR\dllcache\d3d9.dll" 1052 1057 ${CopyFileEx} "${un}" "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 1053 1058 ${EndIf} 1054 1059 1055 1060 !if $%BUILD_TARGET_ARCH% == "amd64" 1061 $PrepareWRPFileEx} "${un}" "$g_strSysWow64\d3d8.dll" 1056 1062 ${CopyFileEx} "${un}" "$g_strSysWow64\msd3d8.dll" "$g_strSysWow64\d3d8.dll" "Microsoft Corporation" "x86" 1063 $PrepareWRPFileEx} "${un}" "$g_strSysWow64\d3d9.dll" 1057 1064 ${CopyFileEx} "${un}" "$g_strSysWow64\msd3d9.dll" "$g_strSysWow64\d3d9.dll" "Microsoft Corporation" "x86" 1058 1065 1059 1066 ${If} $g_bCapDllCache == "true" 1067 $PrepareWRPFileEx} "${un}" "$g_strSysWow64\dllcache\d3d8.dll" 1060 1068 ${CopyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "Microsoft Corporation" "x86" 1069 $PrepareWRPFileEx} "${un}" "$g_strSysWow64\dllcache\d3d9.dll" 1061 1070 ${CopyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "Microsoft Corporation" "x86" 1062 1071 ${EndIf} … … 1077 1086 !insertmacro RestoreFilesDirect3D "" 1078 1087 !insertmacro RestoreFilesDirect3D "un." 1088 1089 ; Prepares the access rights for replacing 1090 ; a WRP (Windows Resource Protection) protected file 1091 !macro PrepareWRPFile un 1092 Function ${un}PrepareWRPFile 1093 1094 Pop $0 1095 Push $1 1096 1097 ${IfNot} ${FileExists} "$0" 1098 ${LogVerbose} "WRP: File $\"$0$\" does not exist, skipping" 1099 Return 1100 ${EndIf} 1101 1102 ${If} ${FileExists} "$g_strSystemDir\takeown.exe" 1103 ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true" 1104 ${Else} 1105 ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping" 1106 ${EndIf} 1107 1108 AccessControl::SetFileOwner "$0" "(S-1-5-32-545)" 1109 Pop $1 1110 ${LogVerbose} "WRP: Setting file owner for $\"$0$\" returned: $1" 1111 1112 AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess" 1113 Pop $1 1114 ${LogVerbose} "WRP: Setting access rights for $\"$0$\" returned: $1" 1115 1116 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" 1117 !ifdef WFP_FILE_EXCEPTION 1118 VBoxGuestInstallHelper::DisableWFP "$0" 1119 Pop $1 ; Get return value (ignored for now) 1120 ${LogVerbose} "WRP: Setting WFP exception for $\"$0$\" returned: $1" 1121 !endif 1122 !endif 1123 1124 Pop $1 1125 1126 FunctionEnd 1127 !macroend 1128 !insertmacro PrepareWRPFile "" 1129 !insertmacro PrepareWRPFile "un." 1130 1131 ; 1132 ; Macro for preparing the access rights for replacing 1133 ; a WRP (Windows Resource Protection) protected file. 1134 ; @return None. 1135 ; @param Path of file to prepare. 1136 ; 1137 !macro PrepareWRPFileEx un FileSrc 1138 Push $0 1139 Push "${FileSrc}" 1140 Call ${un}PrepareWRPFile 1141 Pop $0 1142 !macroend 1143 !define PrepareWRPFileEx "!insertmacro PrepareWRPFileEx"
Note:
See TracChangeset
for help on using the changeset viewer.