views:

2533

answers:

3

I have an installer that works perfectly under NT 5.x, Vista, and Windows 7. It contains the proper manifest for UAC on NT 6.x.

But starting with Windows 7 RC, every time the setup program closes, Windows produces an erroneous "This program might not have installed correctly" message, even though the program did install correctly with no problems whatsoever. I never got these spurious messages in Vista or in Windows 7 beta.

I sent a bug report to Microsoft, but have not heard back. I thought that this might just be a glitch in the Windows 7 RC, but the problem is still there on a fresh install of one of the very recent RTM-escrow builds that was leaked. Microsoft has no documentation whatsoever about this--not even a hint to what might possibly be triggering it.

Even more frustrating is that I get this "This program might not have installed correctly" message even if I cancel the install on the very first are-you-sure-you-want-to-proceed screen before any of the installation code (creating a temp dir, extracting files, copying, registry, etc.) is ever run.

Has anyone figured this one out?

A: 

Have you thrown the Application Compatibility Toolkit at your installer?

I've never had cause to deal with it before, but this seems like exactly what its intended for.

Kevin Montrose
Yes, I had tried that. Sifted through every entry in the log that was generated and could not find any helpful bits of information.
+6  A: 

Well, to answer my own question, I've found a way to solve this problem. I noticed that the WinRAR changelog indicated that WinRAR's self-extractor also suffered from the same problem, and that it was solved. So I downloaded the latest version of WinRAR and threw it into a disassembler, along with an earlier version, looking for any new API calls, etc. Long story short, it turns out that all that it did was add the following to the manifest:

<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>

Some Googling of the strings turned up some documentation: apparently, this is something new that was added to Windows 7 and that the documentation for it was created on May 20. It didn't help that Microsoft doesn't link to this from any of their Win7 documentation pages, much less feature it prominently. sigh

Edit: This is documented, poorly, on MSDN here.

This doesn't actually solve the underlying problem. You're just telling Windows not to report it anymore. http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx ; Windows 7: Applications with Compatibility section will not get the PCA mitigation. Admittedly, it might be the path to go in some cases.
Kevin Montrose
Well, it's not entirely clear that Windows is reporting this correctly. The installer works as designed with the PCA disabled, and, as I noted in my other comment, I had long ago waded through the app verifier logs and even looked up various API calls to make sure that were wasn't so new Win7 caveat that I had missed. I had stripped the installer down so much that it wasn't even doing anything, and Windows still complained. So I'm pretty sure that this is the right course of action.
Er, s/so new/some new/