How to prevent the Program Compatibility Assistant from appearing on Windows Vista
While researching the root cause of the issue that can cause a Windows XP SP2 block dialog to appear when trying to install the .NET Framework 3.5 beta 1 on Windows Vista (described in more detail in this blog post), I learned some useful information about the Program Compatibility Assistant (PCA) that I wanted to summarize here.
What kinds of applications are affected by the Program Compatibility Assistant?
The Program Compatibility Assistant monitors setup applications that it detects are not Windows Vista-aware. The PCA uses a list of well-known names such as setup.exe, install.exe, etc to try to decide whether or not an application is a setup. The PCA treats all setup applications that do not have an embedded manifest that specifies a requested execution level (asInvoker, highestAvailable or requireAdministrator).
In the case of the .NET Framework 3.5 beta 1, the setup package did not include an embedded manifest specifying a requested execution level, and it was named dotnetfx35setup.exe, which triggers the Windows Vista legacy setup application detection logic.
When does the Program Compatibility Assistant appear?
Once the Program Compatibility Assistant identifies a non-Windows Vista-aware setup application, it will monitor the Programs and Features control panel (previously known as Add/Remove Programs). If an entry is not created or removed from the Programs and Features control panel, then the PCA treats the process as a failed setup and displays a dialog after the setup process exits that asks if the user wants to attempt to re-install using recommended settings. In this case, using recommended settings will cause Windows Vista to re-run the setup using Windows XP SP2 compatibility mode.
In the case of the .NET Framework 3.5 beta 1, because the setup application is treated as a non-Windows Vista-aware setup, whenever it returns without creating or removing a Programs and Features control panel entry, the PCA dialog will appear (even if you simply launch setup and cancel on the End User License Agreement page).
How can I opt out of the Program Compatibility Assistant for my setup?
In order to prevent the Program Compatibility Assistant from appearing, you must include an embedded manifest that specifies a requested execution level for your setup executable. If you wrap the setup executable in a self-extracting package, you must also include an embedded manifest in the self-extracting package too. Once you do this, Windows Vista will treat your setup as Windows Vista-aware, and it will no longer show the PCA dialog when setup exits after a failure or cancellation.
Where can I find more detailed documentation?
For more detailed information about the Program Compatibility Assistant, I encourage you to check out the following resources:
- The Windows Vista Developer Story: Application Compatibility Cookbook - https://www.microsoft.com/indonesia/msdn/appcomp.aspx
- Windows Vista Application Development Requirements for User Account Control Compatibility - https://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF-BC5E-A2EEBB74C16B&displaylang=en
Comments
Anonymous
May 17, 2007
Does PCA's detection of Vista-Awareness depend on whether or not UAC is ON/OFF? I ask this because I have a setup executable that indeed has a manifest specifying 'requireAdministrator'. When canceling out of my setup, the PCA dialog will appear only when UAC is off. And my manifest should be well-formed, since it invokes a UAC dialog upon launch when UAC is on. Any tips as to how to prevent the PCA dialog from showing up with UAC off?Anonymous
May 23, 2007
Hi Symkt - I haven't heard of this issue until now. Would it be possible for you to zip and send me your setup.exe so I could take a look at this in more detail? You can send it to Aaron.Stebner (at) microsoft (dot) com.Anonymous
May 26, 2007
The comment has been removedAnonymous
May 27, 2007
Hi Bp9129 - I haven't tried to install Windows XP from within Windows Vista before, so I don't know for sure if that is expected to work. Can you try to boot from your Windows XP CD and install from there instead of running it from within Windows Vista?Anonymous
August 02, 2007
I previously posted a description of a bug in VS 2008 beta 1 and .NET Framework 3.5 beta 1 setup thatAnonymous
August 02, 2007
I previously posted a description of a bug in VS 2008 beta 1 and .NET Framework 3.5 beta 1 setup thatAnonymous
October 15, 2007
Recently, a fellow Microsoft employee found this blog post that I wrote a while back, and he contactedAnonymous
October 15, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/10/16/narrowing-down-odd-behavior-in-the-program-compatibility-assistant-on-windows-vista/Anonymous
August 17, 2010
I created an unmanaged application without the manifest on Visual Studio 2010. The first time I run this compatibility assistant pops up. This is not a setup application just an executable without common setup names like install.exe or setup.exe. Since it is not a setup app it has nothing to do with ARP. Why should I get a message that it was not properly installed? Do Vista or Windows 7 always behave like this if they see an application (without a manifest) for the first time?Anonymous
August 18, 2010
Hi Umesh - I don't know the exact logic that Windows uses behind the scenes, but I don't believe that it will trigger this PCA dialog for every application that doesn't have a manifest. It has some kind of logic that tries to "guess" whether or not a program is a setup program. What is the exact name of the application you're seeing this for? You may also want to try to post a question on this on one of the Windows application compatibility forums to see if someone there can help advise you regarding why you're seeing a PCA dialog triggered for your application.