Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reasons for getting the Program Compatibility Assistant dialog?

Tags:

What are possible reasons for getting the Program Compatibility Assistant dialog after my application closes?

Program Compatibility Assistant image
(source: microsoft.com)

EDIT: Program Compatibility Assistant: frequently asked questions

I realize this question has already been asked on S.O.

  • Program Compatibility Assistant thinks my app is an installer
  • Windows 7 Program Compatibility Assistant appeared for my app. Why?
  • Why I receive a message from the Program Compatibility Assistant?
  • How do I prevent programmatically the “Program Compatibility Assistant” in Vista (and Windows 7) from appearing?

However, my app:

  1. Only gets PCA after it closes
  2. Does not attempt to do anything that requires elevated privileges (I don't think)
  3. Does not get PCA when run from IDE
  4. Is not an installer/setup program
  5. Does not have "installer" or "setup" in the program name
  6. Does not throw an exception when it closes, or exit with a code other than 0 (I don't think)
  7. Does not get PCA if I add <compatibility> node to application manifest

Note #6, with the following app.manifest, I no longer get the PCA:

<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">     <security>       <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">         <requestedExecutionLevel level="asInvoker" uiAccess="false" />       </requestedPrivileges>     </security>   </trustInfo>   <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">     <application>       <!--The ID below indicates application support for Windows Vista -->       <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>       <!--The ID below indicates application support for Windows 7 -->       <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>     </application>   </compatibility> </asmv1:assembly> 

So that second part seems to fix it, but I am worried that my application is still doing something that I am unaware of.

To be clear, I'm asking a 2 part question:

  1. What issues can cause the PCA dialog to appear?
  2. Is the <compatibility> node absolutely necessary in order to avoid the PCA dialog? Or might I still be doing something wrong?
like image 782
JohnB Avatar asked Feb 23 '11 23:02

JohnB


People also ask

What does program Compatibility Assistant Do?

Program Compatibility Assistant (PCA) is a feature in Windows 8 that helps end users to run desktop apps designed for earlier Windows versions. Windows 8 has great built in app compatibility that enables apps designed for Windows 7 or earlier Windows versions to work great on Windows 8 automatically.

What is program Compatibility Wizard?

The Program Compatibility Wizard prompts you to test your program in different modes (environments) and with various settings. For example, if the program was originally designed to run on Microsoft Windows 95, set the compatibility mode to Windows 95, and then try to run your program again.


1 Answers

This MSDN article describes the many conditions that can cause the Program Compatibility Assistant to kick in. I would review the set of scenarios that it describes and see whether any of them apply to your program. I do see causes for PCA dialogs outside of the conditions you ruled out (e.g., attempting to create a new folder under %ProgramFiles%).

like image 174
Andrew Brown Avatar answered Dec 05 '22 00:12

Andrew Brown