AccessControl plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
Line 5: Line 5:


== Description ==
== Description ==
'''Version:''' 13th July 2007.<br>
'''Version:''' 21st August 2007.<br>
'''Supported on:''' ''Windows ME+, Windows 2000+''.
'''Supported on:''' ''Windows ME+, Windows 2000+''.


Line 14: Line 14:
'''Changes:''' Error MessageBox removed. Error messages are now just returned on NSIS stack.<br />
'''Changes:''' Error MessageBox removed. Error messages are now just returned on NSIS stack.<br />
'''Updated:''' 13th July 2007 ~ kichik<br />
'''Updated:''' 13th July 2007 ~ kichik<br />
'''Changes:''' Return proper error codes (return value instead of GetLastError()).
'''Changes:''' Return proper error codes (return value instead of GetLastError()).<br />
'''Updated:''' 21st August 2007 ~ Afrow UK<br />
'''Changes:''' Added /NOINHERIT, EnableInheritance, DisableInheritance.<br />


== Usage Example ==
== Usage Example ==

Revision as of 17:17, 22 August 2007

Author: tbf (talk, contrib)


Links

AccessControl.zip (48 KB)

Description

Version: 21st August 2007.
Supported on: Windows ME+, Windows 2000+.

The AccessControl plugin for NSIS provides a set of functions related Windows NT access control list (ACL) management.

Original: 20th April 2006
Updated: 30th June 2006 ~ Afrow UK
Changes: Error MessageBox removed. Error messages are now just returned on NSIS stack.
Updated: 13th July 2007 ~ kichik
Changes: Return proper error codes (return value instead of GetLastError()).
Updated: 21st August 2007 ~ Afrow UK
Changes: Added /NOINHERIT, EnableInheritance, DisableInheritance.

Usage Example

# Give ownership for file C:\test.txt to Waterloo\Mathias
  AccessControl::SetFileOwner \
    "C:\test.txt" "Waterloo\Mathias"
 
# Make the directory "$INSTDIR\database" read write accessible by all users
  AccessControl::GrantOnFile \
    "$INSTDIR\database" "(BU)" "GenericRead + GenericWrite"
 
# Give all authentificated users (BUILTIN\Users) full access on
# the registry key HKEY_LOCAL_MACHINE\Software\Vendor\SomeApp
  AccessControl::GrantOnRegKey \
    HKLM "Software\Vendor\SomeApp" "(BU)" "FullAccess"
 
# Same as above, but with a numeric string SID
  AccessControl::GrantOnRegKey \
    HKLM "Software\Vendor\SomeApp" "(S-1-5-32-545)" "FullAccess"

Detailed usage instructions can be found in the package.

Credits

Written by Mathias Hasselmann