Archive: AccessControl (i cant use it)


AccessControl (i cant use it)
Hi there,
I'm obviously missing something, i can't get the AccessControl plugin to work.

I'm using Vista, running as an admin user with the UAC turned on.

I'm trying to make a file have generic read and generic write access for all users, or maybe just full acccess.

I've tried the line:

AccessControl::GrantOnFile "$strMachineIniPath" "(S-1-1-0)" "GenericRead + GenericWrite"

But this gives me an error when I compile, am I missing something such as including the dll or something?
I've copied the AccessControll.dll to the same directory as my install script (nsi and ini's).


After reading up on how to use a dll I've tried:
System::Call 'AccessControl.dll::GrantOnFile(t ."$strMachineIniPath", t ."(S-1-1-0)", t ."FullAccess")'

This compiles but does not seem to do what I wanted.


Also does a return value get pushed? I tried pop $r1, it had "success" in it, was that from this call or left over from a previous function call?


Any help would be greatly appreciated, I've been reading the forums all morning and still dont see what I'm doing wrong.
Thanks,
Coolblu77.

use !addpluginsdir in you script OR put AccessControl.dll in \NSIS\plugins


Thanks for the reply Anders.

I knew it would be something simple like that, I'm sure I read that NSIS looks in the current directory as well as those defined for plugins, but maybe not.

Anyway thats working now.

And I can see that it is returning a response on the stack.


One other question, I'm setting the Security Access Controls for a directory just after its been created, I was hoping that any files copied to that directory would inherit the settings of the directory, but they dont seem to be.

Do I need to call EnableFileInheritance or anything?
Or am I just going to have to call GrantOnFile for each file?


I think I've solved my other problem, just posting in case it helps anyone else.

I'm now calling AccessControl::GrantOnFile for the directory, after I've copied over the files that need to inherit, this seems to work.


Thanks for following up. I think I'm going to have to deal with this soon.