Reputation: 205
I'm currently packaging an application to run in compatibility mode. I easily found the location where the registry keys are created in the HKLM (for all users) or HKCU (for only the logged on user).
The problem is; which I really don't know if it's a problem, I can set the registry key in HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers. I create a REG_SZ with the name of the key being the path.
E.G.: C:\Program Files (x86)\MyApplicationDirectory\MyApp.exe
The value of this key is ~WIN7RTM
The problem is this, when I install the application and I create a registry key with this path. I can click on the shortcut properties and go into the Compatibility Tab and noticed it does not appear it's set to run in Compatibility Mode in Windows 7.
I know I created the correct registry key because I originally created the shortcut through the compatibility tab and clicked "Change Settings for All Users" and then set it to run in Windows 7 there. If I set compatibility mode within the shortcut, I can see it checked. (highlighted in yellow)
But if I try to set compatibility mode via the registry key and I go into the properties of the EXE or shortcut, the box is not checked.
Upvotes: 6
Views: 16898
Reputation: 205
Never mind folks. I did a stare and compare on the registry keys that is created. I did not add a space between the ~ and WIN7RTM. Once I added a white space, it worked fine.
Before: ~WIN7RTM (not correct)
After: ~ WIN7RTM (correct)
Overlooked it.
Upvotes: 7