"This program might not have installed correctly"
Asked Answered
C

1

9

I am aware of both this and this questions.

Which unfortunately didn't quite answer what I'd like to know:

  1. The answers in the above questions suggest that it has to do with adding shortcuts to the start menu, but that can't be the sole reason. So far I've been unable to reliably figure out what makes windows think my application is an installer in the first place and why does windows think it failed?

  2. I do not want to simply suppress the message with a compatibilty tag in the manifests. I want to write a proper solution and tell Windows if my installation has failed or not. Also, what does the install using recommended settings option do, that comes along with the dialog? How can I properly utilize this functionality? Again, I don't want to simply disregard the features Windows provides, I'd like to use them.

I've been browsing around MSDN but with no success. I've asked google, but all I could find is ways to suppress the message using compatibility tricks in either the manifest or the registry. I'd be already grateful if someone could provide a viable resource on MSDN that covers this topic well.

So far, I am using a custom installer that utilizes several Windows API calls. I am not messing around with the Windows Registry other than registering two services. It also has requireAdministrator as the requested execution level (not that anyone cares, but this is suprisingly clean and simple - it's merely a flag in the project settings). I am currently not using MFC or CLR.

Cajeput answered 11/3, 2011 at 17:50 Comment(0)
P
11

See Installer Detection, it lists what is checked to decide whether an executable is an installer.

"This program might not have..." is a product of "Program Compatibility Assitant", and is documented in the Application Compatibility: Program Compatibility Assistant (PCA) topic. According to the document the reinstall option applies XPSP2 compatibility mode.

Planimeter answered 11/3, 2011 at 18:25 Comment(3)
That was an interesting read. To be honest, I didn't expect it to work like that - i.e. that it's solely there for detecting non-Vista compatible installers. I thought of it more like a general feature to support installers aimed for Vista and 7 - but it's not. Quite interesting ... and intimidating ..., how much checking and monitoring Windows performs all the time. Anyway, simply setting requestedExecutionLevel="requireAdministrator" as described in my question seems to be the recommended way according to those documents. Thanks.Cajeput
@Cajeput - You're welcome! Additionally, AFAIU, if UAC decides it is an installer, PCA will require an entry in "add remove programs".Planimeter
Thank you for the link...I had the same problem just because my app executable name ended with "Setup.exe"...what a crappy check by Windows!Burnley

© 2022 - 2024 — McMap. All rights reserved.