I'm glad to help !
Eventually I learned something from your post, since I didn't know it was possible to apply compatibility layers through environment variables...
Regarding the registration of new UAC virtualisation places I can't send you pointers here, since I discovered it in an O'Reilly book some time ago, didn't see the info anywhere else and confirmed it somehow through hex dumping of the UAC virtualisation filesystem filter driver, luafv.sys. That's the problem with closed systems, information can be difficult to find sometimes...
But back to the point, to register a new directory, you have to modify the registry. In my case, I wanted to register D:\Program Files (x86), that's what I did :
----- COPY AFTER THIS LINE-----
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\luafv\Parameters\FileList\Device]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\luafv\Parameters\FileList\Device\HarddiskVolume2]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\luafv\Parameters\FileList\Device\HarddiskVolume2\Program Files]
"Exclude"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\luafv\Parameters\FileList\Device\HarddiskVolume2\Program Files (x86)]
"Exclude"=dword:00000000
----- COPY UP TO BEFORE THIS LINE ---
This is an export of my personal registry settings, I hope it's clear enough. You will notice two directories have been added eventually : D:\Program Files (x86) and D:\Program Files, make changes as you wish.
But before this, you have to determine another piece of information about the volume pointed by the drive letter D on your system, that's called the physical device object name. In my case it's HarddiskVolume2, but it can be different for you, since it's unrelated to the drive letter. For this purpose, you can use the filter manager command line tool, fltmc.
Start an admin command prompt, then type :
fltmc volumes
You should get something similar to this :
Nom DOS Nom du volume Sys. fich. Statut
------------------------------ --------------------------------------- ---------- --------
\Device\Mup Remote
C: \Device\HarddiskVolume6 NTFS
D: \Device\HarddiskVolume2 NTFS
\Device\HarddiskVolume3 NTFS
\Device\NamedPipe NamedPipe
\Device\Mailslot Mailslot
\Device\HarddiskVolume4 FAT
On my system you can see that C: corresponds to \Device\HarddiskVolume6, and D: to \Device\HarddiskVolume2. Check the output on your system, and make changes accordingly. Then, reboot your system. Not shutdown-power on, reboot. That's because of the fast startup feature of Windows (appeared with Windows 7, enabled by default but can be disabled), when the system is shut down, before it's powered off, system processes don't really exit, their state is just saved on disk and restored when powered back on. Anyway... once the system is rebooted, you should be fine.
One last thing, in the not-so-unlikely case you have a 64-bit system, the RUNASINVOKER compatibility layer won't activate UAC virtualisation on 64 bit executables. That's because UAC virtualisation was originally designed to mitigate problems with
old software trying to write to places where it was permitted at the old times of Windows 98/Me and before. 64-bit software is deemed new so should not need this MS thought, but truth is some developers still develop as if the Win98 security model was current (fortunately this is becoming rare nowadays).
However, it's still possible to activate UAC virtualisation, but to my current knowledge it has to be made by hand each time the program is started, from the task manager. In the details tab you can right-click on the process and choose "User account control virtualisation". But the problem is you have to start the process for it to appear in the task manager, and it may already have tried to write to forbidden places and got access refused errors, in which case you may come too late. Fear not, there's a solution for this, you should apply what is called a "non blocking apphelp message" to the executable, this can be done with Microsoft's Application Compatibility Toolkit, that's part of
Microsoft's Assessment and Deployment Kit (ADK) for Windows 8.1.
With a nonblocking apphelp message attached, when you try to run the program, the process is created and visible in the task manager, but it's in a suspended state and a popup appears. Then you can activate UAC virtualisation, and choose to continue running the program from the popup message.
Well, that's a fine wall of text here, but that's it finally !