/build/static/layout/Breadcrumb_cap_w.png

How to delete a Reg Key without a permission

Wise Installation Studio 7

I have a problem on deleting a Registry Key in HKEY_CLASSES_ROOT\CLSID

On uninstalling my app Windows Installer tells me that I don't have the permission to delete the key called Dummy e.g.

How can I manage it to get this permission on programming...

Thanks in advance...

0 Comments   [ + ] Show comments

Answers (10)

Posted by: mekaywe 14 years ago
Brown Belt
0
Is that key coming from your app? If so it will be deleted automatically
If the key is used by any other application during uninstalling ur app. It will not be deleted.
Posted by: McRip 14 years ago
Orange Senior Belt
0
Itis from my app, that's the problem...
How can I get the permission to get it deleted by windows installer...
Posted by: anonymous_9363 14 years ago
Red Belt
0
The user account with which you're uninstalling has insufficient access rights to delete the key. You need to uninstall (and install, for that matter) with an admin-level account. If you're using the local administrator account and still can't remove the key, you have problems outside of the scope of packaging/scripting.
Posted by: anonymous_9363 14 years ago
Red Belt
0
Is that key coming from your app? If so it will be deleted automatically
If the key is used by any other application during uninstalling ur app. It will not be deleted.
Can you explain the logic behind this assertion? How does any package (note: package, not application) know whether or not a registry value or key is safe to delete? An extreme example but have a go at deleting 'HKEY_CLASSES_ROOT\CLSID\{00000300-0000-0000-C000-000000000046}' and see how far your machine gets.
Posted by: mekaywe 14 years ago
Brown Belt
0
If package is delivering any key, it will try to delete it in general scenario.
we cant say anything about how machines behaves by deleting the key in HKCR
Posted by: McRip 14 years ago
Orange Senior Belt
0
I can not delete this key by myself using regedit. I am Administrator and not allowed to delete this key. I have manually set the permission to delete it.
Which commandline tool can I integrate into my installer to get the key deleted?
I have tried using substinacle, regini and all this stuff. It all was not successful.

What can I do?
Posted by: anonymous_9363 14 years ago
Red Belt
0
I am Administrator and not allowed to delete this keyWhat permissions does the key have? It wouldn't be connected with an Adobe product, by any chance, would it? They *love* to screw with permissions.

Anyway, see what accounts/groups have 'Delete' rights, make yourself a member of one of those groups and you should then be able to delete it. One dodge you can try if that's no good is running CMD.EXE via the 'AT' scheduler. That gets you a command window with the the local 'System' account:

AT hh:mm /interactive cmd.exe

Run RegEdit from that window. If THAT account doesn't have rights, you're pretty much screwed.
Posted by: McRip 14 years ago
Orange Senior Belt
0
Ok, guys you can close this thread. I found a way that I put into my installer. Now it works from win2k to win 7.

Cheers
Posted by: cygan 14 years ago
Fifth Degree Brown Belt
0
I found a way that I put into my installer. Now it works from win2k to win 7.
and would you like to share your findings and solution for others on this forum [:D]
Posted by: McRip 14 years ago
Orange Senior Belt
0
Download the latest version from subinacle from microsoft:

http://download.microsoft.com/download/1/7/d/17d82b72-bc6a-4dc8-bfaa-98b37b22b367/subinacl.msi

Extract the MSI file with uniextract or something. In that extracted folder you'll find the folder called files. And in the files folder you will see subinacle.exe.
This is a commandline tool for setting new permissions on registry keys.

Just open subinacle via cmd with the following command:
subinacl.exe /keyreg HKEY_CLASSES_ROOT\CLSID\{436F4AD7-C95B-4d2f-B0F8-8DC643F7A200} /grant=[LogonUser] =F

The installer can then delete the key without any errors, cause you have full access for the key.

I integrated in my installer "Execute program from installation" with the command above and it works like charm on each operating system.
Do not use subinacle from the Win2k CD. This older version has some bugs. Use the one frm above.

Edit: Instead of using the variable"%username%" it's better to use "[LogonUser]" for a CustomAction.

Cheers
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ