Windows 7 RC 中的“此程序可能未正确安装”消息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1069135/
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 12:44:27  来源:igfitidea点击:

"This program might not have installed correctly" message in Windows 7 RC

windowsinstallationcompatibility

提问by

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.

我有一个在 NT 5.x、Vista 和 Windows 7 下完美运行的安装程序。它包含适用于 NT 6.x 上的 UAC 的正确清单。

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.

但是从 Windows 7 RC 开始,每次安装程序关闭时,Windows 都会产生错误的“此程序可能未正确安装”消息,即使该程序确实安装正确且没有任何问题。在 Vista 或 Windows 7 测试版中,我从未收到过这些虚假消息。

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.

我向 Microsoft 发送了错误报告,但没有收到回复。我认为这可能只是 Windows 7 RC 中的一个小故障,但问题仍然存在于最近泄露的 RTM 托管版本之一的全新安装中。Microsoft 没有关于此的任何文档——甚至没有提示可能触发它的原因。

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 anyof the installation code (creating a temp dir, extracting files, copying, registry, etc.) is ever run.

更令人沮丧的是,即使我在任何安装代码(创建临时目录、提取文件、复制、注册表等)一直在运行。

Has anyone figured this one out?

有没有人想出这个?

回答by

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:

好吧,为了回答我自己的问题,我找到了解决这个问题的方法。我注意到 WinRAR 的更新日志表明 WinRAR 的自解压器也遇到了同样的问题,并且已经解决了。所以我下载了最新版本的 WinRAR 并将其与早期版本一起放入反汇编器中,寻找任何新的 API 调用等。长话短说,结果证明它所做的只是将以下内容添加到清单中:

<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

对字符串的一些谷歌搜索出现了一些文档:显然,这是添加到 Windows 7 的新内容,并且它的文档是在 5 月 20 日创建的。微软没有从任何他们的 Win7 文档页面,更不用说突出显示它了。

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

编辑:这是记录,不良,MSDN上这里

回答by user876725

I ran into the same error message when running a new Qt based app I built. Same symptoms - would get this 'helpful' message after the .exe closed, no matter what the program did.

在运行我构建的基于 Qt 的新应用程序时,我遇到了相同的错误消息。相同的症状 - 无论程序做什么,都会在 .exe 关闭后收到此“有用”消息。

Now I have various qt app projects, all built the exactly the same way. And none of the others do this.

现在我有各种 qt 应用程序项目,它们都以完全相同的方式构建。其他人都没有这样做。

I finally figured out that this error was caused solely by the fact that I had named this particular project 'installer'. I had ended up with a binary 'installer.exe' and it would have no doubt had the project name built into it elsewhere (without delving into the qmake generated project file, not exactly sure what).

我终于发现这个错误完全是因为我将这个特定项目命名为“安装程序”。我最终得到了一个二进制“installer.exe”,毫无疑问,它会在其他地方内置项目名称(无需深入研究 qmake 生成的项目文件,不确定是什么)。

The point of interest is that you can run into this problem simply by having a project called 'installer' and nothing else.

有趣的是,您只需拥有一个名为“安装程序”的项目就可以遇到这个问题,而没有别的。

回答by Kevin Montrose

Have you thrown the Application Compatibility Toolkitat your installer?

您是否在安装程序中抛出了应用程序兼容性工具包

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

我以前从未有过处理它的理由,但这似乎正是它的目的。