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.
Deleting compatibility keys
4 posts
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?Originally Posted by Anders View PostYou need to specify the registry path, the key you are after is somewhere under \Software\Microsoft, perhaps Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers?
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.
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"
DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\APP\APP.EXE"