You are here

Cannot delete registry keys in HKLM with Administrator privilege

4 posts / 0 new
Last post
Reisll
Offline
Last seen: 8 years 5 days ago
Joined: 2016-02-27 04:04
Cannot delete registry keys in HKLM with Administrator privilege

Hi everyone,

I'm currently making a portable version of Adobe Photoshop CC. It's working fine now. However, some of the registry keys are generated and stored in HKLM (just trash keys and not important). I want to delete all these keys when the application exit to make it truely portable and leave no trace behind. I tried to run the program as Admin, put "RunAsAdmin" in Launch section, put the keys in [RegistryCleanupIfEmpty], [RegistryCleanupForce] but no help.

Is this a bug or I'm missing something?

Thank!

Update:
- Keys that are under HKLM\SOFTWARE\Wow6432Node are deleted normally. Keys under HKLM\SOFTWARE cannot be deleted.
- I checked debug log and it shows a line which is: "Deleting registry key..." (for keys under HKLM\SOFTWARE). But no key is deleted.

newbie291
Offline
Last seen: 7 years 12 months ago
Joined: 2016-04-01 16:21
I ran into a similar problem

I ran into a similar problem on x64 machine. The investigated program (with an explicit setup for 64bit) also added an HKLM\Software\myprogram entry, which couldn't be accessed via [Registry].
Did you try to use SetRegView64 in a segment before the [Registry] is initialized (in your Custom.nsh, e.g. Segment.onInit ) ? I think, this could be a way forward....

RagingCain
RagingCain's picture
Offline
Last seen: 7 years 10 months ago
Joined: 2016-05-24 10:44
Possible Windows 8+ Solution

If this is on Windows 8+, my experience with the registry since the UAC change is that even with Admin, you may not be able to make changes to certain registry keys.

The IT work around, don't know if it's frowned upon, is to take ownership of the file or registry key, which you CAN do with Admin, then make changes. Its not a widely known "feature" still as the early adopters were mostly not the high technical kind but they are slowly being forced for various reasons (mandatory Windows 10 update push on accident).

There is a method of using PSEXEC to use "SYSTEM" to set "OWNERSHIP" to a specific user, if you are still blocked from taking ownership of the registry key, so that you can make some arbitrary change.

Ridiculousness I know Smile

Personal Website: ByteMeDev.com

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 1 week ago
DeveloperModerator
Joined: 2008-07-24 18:46
Commercial, non-modify license

As Photoshop is a commercial product, and specifically prohibits modification in it's EULA, you will not be receiving help from us on how to modify it.

Log in or register to post comments