如何防止Vista上的"此程序可能没有正确安装"消息

Jas*_*son 49 installer windows-installer uac windows-appcompat-platform

我有一个产品安装程序可执行文件,可以将一些文件复制到用户的硬盘上.它不是正常意义上的典型安装程序(它不会向"开始"菜单或"程序文件"文件夹添加任何内容).

每次在Vista上运行安装程序时,在exe终止后,Vista会生成一个任务对话框:

  • 此程序可能未正确安装
  • 使用推荐配置重新安装
  • 这个程序正确地安装了

是否有一个函数我需要从exe或注册表项调用来设置,以指示操作系统正确安装程序(或至少压制此消息)?

相关问题: Windows 7 RC中的"此程序可能未正确安装"消息(适用于Windows 7特定问题)

小智 44

在程序的清单文件中包含此部分:

<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}"/>
    <!--The ID below indicates application support for Windows 8 -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
    <!--The ID below indicates application support for Windows 8.1 -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
    <!--The ID below indicates application support for Windows 10 -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

  </application>
</compatibility>
Run Code Online (Sandbox Code Playgroud)

它会通过声明您的应用与Vista和Win 7兼容来抑制程序兼容性助手.

  • Windows 8的GUID(如果有人需要它)是{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38},尽管似乎没有必要抑制PCA提示. (8认同)
  • 仅适用于从未使用任何"清单"的其他人:转到Visual Studio项目>属性>应用程序>查看Windows设置>关于第26行 (4认同)

Jon*_*ant 7

您需要将一些信息添加到注册表的AppCompat部分.

请参阅此链接并查找"如何禁用程序兼容性助手警告".

此外,显然有一种方法涉及将清单文件添加到您的安装程序可执行文件,以将其标记为"Vista-aware".

  • 对于安装程序来说,混淆AppCompatFlags可能不是一个好主意,那就是IT /管理员 (4认同)