问题
My installer sets a compatibility mode for an app via registry (for all users):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Program\\Program.exe"="RUNASADMIN"
Windows 10 ignores this, though, - no UAC prompt until I open properties/compatibility tab, manually deselect "run as admin", and select it back. Another solution is to create an registry entry for the current user as well:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Program\\Program.exe"="RUNASADMIN"
Why is this? I've had no problems with creating only HKLM registry keys under Win 7 - the system has always recognized the needed compatibility options.
回答1:
It may be that do what you are doing you need to add ~ and a space. As in "~ RUNASADMIN". This worked for me. There is more discussion on this at Windows Ten Forums.
来源:https://stackoverflow.com/questions/36116489/windows-10-compatibility-feature-bug