Sunday, December 20, 2009

Enabling UAC Virtualization so old plugins can save settings

Originally, Windows had no filesystem security, and applications could write data wherever they wanted. Because of that old software often stores settings in the Windows directory or the application directory. For example, old Winamp plugins store their settings into the plugin directory (typically C:\Program Files\Winamp\Plugins). Starting with Vista, writing to those directories requires administrative privileges. To allow old software to function correctly, Windows can redirect such accesses to a place within the user's profile folder (%userprofile%\AppData\Local\VirtualStore). The same issues can exist with registry writes, and Windows can also redirect those. When an application is specifically designed for Vista or Windows 7, this redirection (called UAC Virtualization) is not needed and so it is disabled.

This normally works so well that one doesn't need to know about it. However, it fails when an application designed for Vista or Windows 7 loads old plugins. For example, some old Winamp plugins cannot save settings. Here are some solutions:
  • Grant write access to the directory.
  • Delete the manifest resource from the executable using a registry editor. However, some executables such as winamp.exe require the manifest resource.
  • Edit the manifest resource in the executable and remove the trustInfo section from the manifest. This means removing text from "<trustinfo" to "</trustinfo>". It's best to use a resource editor, but you can overwrite the text with spaces in a hex editor.
Task Manager can tell you if UAC Virtualization is enabled: right click on the executable and look for the check mark by "UAC Virtualization". This method can be used to change the setting, but I do not recommend it because it would have to be repeated every time the application is run.

No comments: