I want to grant a permission to my service to user/everyone. I can use subinacl to grant such permissions but am not usre how to code for it in the Installer class ?
And also if I want to grant permission to every user on the comp, can I use "Everyone" as user?
What is the system doesn't have any users - I mean on XP without any users, then how to handle the same.
Please help me at the earliest. Any help is highly appreciated.
EDIT : To grant permission I found this : http://ss64.com/nt/subinacl.html and this . I tried on cmd and it worked. I wrote the following to make it happen :
WshShell shell = new WshShellClass();
object wf = IWshRuntimeLibrary.WshWindowStyle.WshHide;
//object ws = IWshRuntimeLibrary.
if (allusers)
shell.Run("subinacl /SERVICE \"OpenVPNService\" /Grant=Everyone=TO", ref wf, true);
else
shell.Run("subinacl /SERVICE \"OpenVPNService\" /Grant="+ Environment.UserName +"=TO", ref wf, true);
shell = null;
The last parameter is giving problem. I needto pass a ref obj only. And it represents to show the window or not. Check Here I get error "Argument 3: cannot convert from 'bool' to 'ref object'. Any idea what to give in 3rd parameter.