Program Compatibility Assistant (PCA) in Windows Vista
Introduction to PCA
The Program Compatibility Wizard in Help and Support and the Compatibility tab in file properties are useful tools for users to fix program compatibility issues in Windows XP. The major limitation with these tools is the discoverability and the fact that the user needs to know when to use these tools. The Program Compatibility Assistant (PCA) is a new feature in Windows Vista that can make older programs that have compatibility problems work better, in an automated manner. PCA monitors programs for known issues. If an issue is detected, it notifies the user of the problem and offers to apply solutions that will be effective before the user runs the program the next time.
Note PCA is a client-only feature and is not available on the Server.
The following sections describe the scenarios in which the user is expected to encounter PCA, details on the user experience, the solutions applied in each of those scenarios and how to manage the settings made by PCA at a later time. The last section talks about how to exclude programs from PCA.
PCA Scenarios
Detecting Failures in Setup Programs
One of the main scenarios for PCA is to detect setup programs failing to install on Windows Vista and to provide the solution of applying the Windows XP compatibility mode.
The most common setup failure is due to installers hard coding the check for the Windows OS version that they can run on. These installers will typical fail with an error message saying that the current version of Windows is not supported and terminate.
Below is an example of such error message, illustrated by a test program.

Figure 10.
To give more details on this, programs commonly use GetVersion or the GetVersionEx APIs to get information on the Windows OS version that they are running on. In Windows Vista these APIs will return 6 as the major version. If the program is hard coded to look for the XP version, which is major version 5, then it will fail in Windows Vista. The XPVersionLie fix included in the Windows XP compatibility mode will provide the XP version of the OS to the program, when it calls GetVersion or GetVersionEx APIs.
PCA targets to detect this scenario and will display a user interface similar to the one below after the installer is terminated. This scenario also covers uninstallers and a similar dialog will show be shown.

Figure 11.
When the user selects the option to Reinstall using recommended settings, the WINXPS2 compatibility mode will be applied to the installer program and the installer will be automatically restarted.
More details on what happens under the covers are explained through the Question / Answer below:
- What is the detection logic and how does PCA know that the setup failed due to version problems?
PCA does not specifically look for the setup's failing due to version problems. The logic used by PCA is to detect if a setup did not complete successfully. It monitors a program detected as setup by Windows Vista and checks if the program registers an entry in Add or Remove Programs (ARP). If no entries are created in ARP then PCA concludes that the installer did not complete successfully. It will then wait for the install program to terminate before displaying the UI. If it is an uninstaller then the detection looks for whether an entry is deleted from ARP.
- How does PCA get information about the setup programs?
PCA relies on the User Access Control (UAC) feature in Windows Vista to know if a program is setup. UAC includes detection for setup programs and will make sure the detected setup programs will be run as administrator. This includes getting administrative credentials or confirmation from the user before launching the program.
- What does each option in the PCA dialog for setups do?
- Reinstall using recommended settings
This will apply the Windows XP compatibility mode and restart the program. Refer to the section below on managing PCA settings to get more details on how the compatibility mode is applied.
- The program installed correctly
It is possible that in some cases, PCA might come up for a setup program that completed correctly but did not create an entry in ARP. In those cases, users can use this option to suppress the PCA dialog the next time.
- Cancel
PCA will do nothing.
All these options will result in the PCA dialog to disappear. PCA will not show up again for the same setup program except when the user selected the 'cancel' option on the previous PCA dialog.
Detecting program failures under UAC
The second main scenario category for PCA is to detect program failures while running under User Access Control (UAC). PCA detects 3 different types of program failures under UAC, which are described below.
Detecting program failures while trying to launch installers
PCA detects this particular scenario of a program not running as administrator and is experiencing a failure while launching a child exe, because the child program is required to run as administrator. This will typically be the case for programs trying to launch an updater.exe. This is because Windows Vista returns a new error code to programs trying to launch an executable which is detected to run as administrator. If the same updater.exe is run from explorer it will run as administrator since explorer knows how to handle this error code and launch the UAC consent UI asking for administrator credentials or approval and finally run the program as administrator.
Below is an example of a PCA dialog that will show up in this scenario, illustrated by a test program.

Figure 12.
Here the test program was trying to launch an updater which is required to run as administrator and failed. In this case, PCA will apply the ELEVATECREATEPROCESS compatibility mode, which will enable the program to successfully launch the child exe as administrator the next time. Now when the program is run the next time and while trying to launch the updater, it will not fail and will successfully run as administrator. The user will see the UAC consent UI.
More details on what happens under the covers is explained through Q/A below.
- What is the detection logic and how does PCA know that the program failed to launch a child exe which needs to run as administrator?
The detection for this scenario is accomplished through instrumentation at the CreateProcess API to detect the cases when a child process launch fails due to the requirement to run as administrator.
- Why are there no options in this PCA dialog?
Due to the high confidence on the issue detection in this scenario, the solution (ELEVATECREATEPROCESS compatibility mode) is automatically applied and the user is not given any options.
Detecting installers that need to be run as administrator
One of the tenants of Windows is that the installation of most software requires administrative privileges. This is because installed applications are loaded into system directories and manipulate system resources. Install detection feature part of the overall User Access Control (UAC) feature in Windows Vista aids in this by identifying setup programs and automatically prompting the user for administrator approval or credentials. In some cases it is possible that an install program may not be detected by UAC. These are typically custom made installers which are not built using any standard installer technologies like Install Shield, Microsoft Windows Installer, etc.
PCA targets to detect this scenario and will display a user interface similar to the one below after the installer is terminated.

Figure 13.
When the user selects the option to 'Restart the program as administrator', the program will be marked to run as administrator and will be automatically restarted.
More details on what happens under the covers are explained through the Question / Answer below:
- What is the detection logic and how does PCA know that the program needs to run as administrator?
The logic used by PCA is to detect if the program tried to create a sub folder under the Program Files directory and subsequently tried to copy an .exe or .dll file inside it. PCA assumes these as the common actions performed by an installer. PCA relies on events from the File virtualization feature as part of the overall User Access Control (UAC) feature for detecting this. When a program is not running administrator, writing to the Program Files directory is not permitted as it is one of the system locations. File Virtualization tries to address this by redirecting the writes attempted on a system location to a Virtual store. For example, it supports redirecting a directory creation in the virtual location and writing document files but does not support redirecting binary files like .DLLs or .EXEs. In either case, File Virtualization sends events that can be consumed by PCA.
- What does each option in the PCA dialog for this scenario do?
- Restart the program as an administrator
This will apply the 'RunAsAdmin' compatibility mode and restart the program. Refer to the section below on managing PCA settings to get more details on how the compatibility mode is applied.
- The program installed correctly
It is possible that in some cases, PCA might come up for a setup program that completed correctly. In those cases, users can use this option to suppress the PCA dialog the next time.
- Cancel
PCA will do nothing.
PCA will not show up again for the same program except when the user selected the 'cancel' option on the previous PCA dialog. |