VirtualBox

Changeset 50423 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Feb 12, 2014 12:17:10 PM (11 years ago)
Author:
vboxsync
Message:

Build fix.

File:
1 edited

Legend:

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

    r50422 r50423  
    864864!define InstallFileVerify "!insertmacro InstallFileVerify"
    865865
     866; Prepares the access rights for replacing
     867; a WRP (Windows Resource Protection) protected file
     868!macro PrepareWRPFile un
     869Function ${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
     903FunctionEnd
     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
    866922;
    867923; Validates backed up and replaced Direct3D files; either the d3d*.dll have
     
    10861142!insertmacro RestoreFilesDirect3D ""
    10871143!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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette