Changeset 50423 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 12, 2014 12:17:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh
r50422 r50423 864 864 !define InstallFileVerify "!insertmacro InstallFileVerify" 865 865 866 ; Prepares the access rights for replacing 867 ; a WRP (Windows Resource Protection) protected file 868 !macro PrepareWRPFile un 869 Function ${un}PrepareWRPFile 870 871 Pop $0 872 Push $1 873 874 ${IfNot} ${FileExists} "$0" 875 ${LogVerbose} "WRP: File $\"$0$\" does not exist, skipping" 876 Return 877 ${EndIf} 878 879 ${If} ${FileExists} "$g_strSystemDir\takeown.exe" 880 ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true" 881 ${Else} 882 ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping" 883 ${EndIf} 884 885 AccessControl::SetFileOwner "$0" "(S-1-5-32-545)" 886 Pop $1 887 ${LogVerbose} "WRP: Setting file owner for $\"$0$\" returned: $1" 888 889 AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess" 890 Pop $1 891 ${LogVerbose} "WRP: Setting access rights for $\"$0$\" returned: $1" 892 893 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" 894 !ifdef WFP_FILE_EXCEPTION 895 VBoxGuestInstallHelper::DisableWFP "$0" 896 Pop $1 ; Get return value (ignored for now) 897 ${LogVerbose} "WRP: Setting WFP exception for $\"$0$\" returned: $1" 898 !endif 899 !endif 900 901 Pop $1 902 903 FunctionEnd 904 !macroend 905 !insertmacro PrepareWRPFile "" 906 !insertmacro PrepareWRPFile "un." 907 908 ; 909 ; Macro for preparing the access rights for replacing 910 ; a WRP (Windows Resource Protection) protected file. 911 ; @return None. 912 ; @param Path of file to prepare. 913 ; 914 !macro PrepareWRPFileEx un FileSrc 915 Push $0 916 Push "${FileSrc}" 917 Call ${un}PrepareWRPFile 918 Pop $0 919 !macroend 920 !define PrepareWRPFileEx "!insertmacro PrepareWRPFileEx" 921 866 922 ; 867 923 ; Validates backed up and replaced Direct3D files; either the d3d*.dll have … … 1086 1142 !insertmacro RestoreFilesDirect3D "" 1087 1143 !insertmacro RestoreFilesDirect3D "un." 1088 1089 ; Prepares the access rights for replacing1090 ; a WRP (Windows Resource Protection) protected file1091 !macro PrepareWRPFile un1092 Function ${un}PrepareWRPFile1093 1094 Pop $01095 Push $11096 1097 ${IfNot} ${FileExists} "$0"1098 ${LogVerbose} "WRP: File $\"$0$\" does not exist, skipping"1099 Return1100 ${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 $11110 ${LogVerbose} "WRP: Setting file owner for $\"$0$\" returned: $1"1111 1112 AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess"1113 Pop $11114 ${LogVerbose} "WRP: Setting access rights for $\"$0$\" returned: $1"1115 1116 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"1117 !ifdef WFP_FILE_EXCEPTION1118 VBoxGuestInstallHelper::DisableWFP "$0"1119 Pop $1 ; Get return value (ignored for now)1120 ${LogVerbose} "WRP: Setting WFP exception for $\"$0$\" returned: $1"1121 !endif1122 !endif1123 1124 Pop $11125 1126 FunctionEnd1127 !macroend1128 !insertmacro PrepareWRPFile ""1129 !insertmacro PrepareWRPFile "un."1130 1131 ;1132 ; Macro for preparing the access rights for replacing1133 ; a WRP (Windows Resource Protection) protected file.1134 ; @return None.1135 ; @param Path of file to prepare.1136 ;1137 !macro PrepareWRPFileEx un FileSrc1138 Push $01139 Push "${FileSrc}"1140 Call ${un}PrepareWRPFile1141 Pop $01142 !macroend1143 !define PrepareWRPFileEx "!insertmacro PrepareWRPFileEx"
Note:
See TracChangeset
for help on using the changeset viewer.