Skip to content
⌘ NSIS Forum Archive

Deleting compatibility keys

4 posts

gruntlord6#

Deleting compatibility keys

Lately, I've been having issues with users turning on compatibility mode and breaking my application. I would like to remove the compatibility registry key through the installer rather then walk the user through doing so manually.

so far, it looks like the following:
DeleteRegKey HKCU "$INSTDIR\APP\APP.EXE"
But this does not delete the affected key. Am I doing something wrong? Is this even the proper key I should be deleting? Any help is appreciated.
Anders#
You need to specify the registry path, the key you are after is somewhere under \Software\Microsoft, perhaps Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers?
gruntlord6#
Originally Posted by Anders View Post
You need to specify the registry path, the key you are after is somewhere under \Software\Microsoft, perhaps Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers?
I guess that would help huh? Guess I had a brain fart. So the line should look like this?

DeleteRegKey HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\$INSTDIR\APP\APP.EXE"

looks fine, but the registry key is still there, must be something else I'm missing or overlooking.
gruntlord6#
Looks like I was also using the wrong function, finally figured it out. The line that I tested and confirmed working is this:
DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\APP\APP.EXE"