windows “这个程序可能没有正确安装”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5276501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:25:06  来源:igfitidea点击:

"This program might not have installed correctly"

windowswinapiinstallerinstallation

提问by dialer

I am aware of both thisand thisquestions.

我知道这个这个问题。

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 placeand 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 propersolution and tell Windows if my installation has failed or not. Also, what does the install using recommended settingsoption 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.

  1. 上述问题的答案表明它与向开始菜单添加快捷方式有关,但这不能成为唯一的原因。到目前为止,我一直无法可靠地弄清楚是什么让 Windows 认为我的应用程序首先是安装程序,为什么 Windows 认为它​​失败了?

  2. 我不想简单地在清单中使用兼容性标签来抑制消息。我想写一个合适的解决方案并告诉 Windows 我的安装是否失败。此外,对话框附带的使用推荐设置选项进行安装有什么作用?如何正确利用此功能?同样,我不想简单地忽视 Windows 提供的功能,我想使用它们。

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.

我一直在浏览 MSDN,但没有成功。我已经问过谷歌,但我能找到的只是使用清单或注册表中的兼容性技巧来抑制消息的方法。如果有人可以在 MSDN 上提供很好地涵盖该主题的可行资源,我将不胜感激。

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

到目前为止,我使用的自定义安装程序利用了多个 Windows API 调用。除了注册两个服务之外,我并没有弄乱 Windows 注册表。它还具有requireAdministrator请求的执行级别(并不是任何人都在意,但这非常干净和简单——它只是项目设置中的一个标志)。我目前没有使用 MFC 或 CLR。

回答by Sertac Akyuz

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.

“此程序可能没有...”是“程序兼容性助手的产物,并记录在应用程序兼容性:程序兼容性助手 (PCA)主题中。根据文档,重新安装选项适用于 XPSP2 兼容模式。