with RegistrySecurity(HKLM\SYSTEM\ControlSet001\Enum\Root\LEGACY_DMLOAD) do
begin
ProtectedDAcl := false;
DAcl.SetFileAccess(Everyone, True);
if DAcl.DeleteItems(Everyone) then
ShowMessage('OK')
else
ShowMessage('NOT OK');
end;
But only modifying this permission and not deleting my key..
I'll use some to clean some keys after uninstall my program
I'm a bit confused. Your code first adds access for Everyone and then removes it again. Is that intentional? What purpose does that have?
Anyway, the code you're using should more or less work, as long as you have enough privileges to change the ACL. You may have to take ownership first if all else fails. One thing: I'm not sure right now which exact syntax you have to use when feeding a registry path into "RegistrySecurity". It might be safer to call RegOpen/CreateKeyEx() yourself and feed the resulting HKEY into RegistrySecurity.
Good night my friend, the above code that i posted by mistake the wrong part
if DAcl.DeleteItems (Everyone) disregard the stretch.
I've got to do what i needed, i was only allowed to change and then run the function to remove key TRegistry, and windows XP I had to work with manipulating tokens to work