I'm trying to use the Set Access Control command on a registry key for the current installing user.
During the install I added messagebox and noticed that the access control for the registry key was not changed even though using the same user that installer is running with I can change permissions.
I then tried to change it for everyone, which also failed
It seems that I can't get Set Access Control to change access.
Anything special that I need to perform?
I am not able to use the code you posted ... probably there was an error when you pasted it, but using the code below I am able to grant read/write permission to "Users".
Your code works but mine does not.
My code tries to add an exception to Microsoft essentials (A.V).
I tried to copy back my code from the support web site and paste it to Installaware and it was fine.
I just found out why it is not working for me. If there is a user set with permissions on this key, Set Access Control won't change his access control.
How can I bypass this issue? Can I remove a user from a key?
I just tried to grant a READ/WRITE permission to Users, over a REG-Key that already has a READ permission ... and it worked fine.
I can only suppose that probably exist something else at the source of your problem and this due the nature of the key your are trying to edit (Microsoft Antimalware). For example, it could be possible that may exist a security policy that affects that key and this due the purpose of the key itself.
I may suggest you to verify if exist any documentation about this, that could be available with the application that generated the key.
I got back to this issue and now I saw that Microsoft antimalware registry has only SYSTEM account with set value enabled.
Is it possible in Installaware to set registry keys while running with SYSTEM account ACL? (without executing external program. A solution that I shal revert to if nothing else helps).
if you run the package under System Account, I am sure you can set registry keys ... but I don't know if that particular key may have some other behaviors.