VS2019 Windows 10 C++ EXE兼容性工具希望以Windows 8的形式运行

发布于 2025-01-17 13:17:56 字数 851 浏览 3 评论 0原文

我正在使用VS2019(16.11.10),并使用Windows SDK 10.0.19041.0创建了C ++ EXE。当我查看Windows 10中EXE的属性时,出现兼容性选项卡,并且故障排除器希望在Windows 8兼容模式下运行EXE。

我已经使用汇编身份添加了嵌入式清单中的信息:

mycompany.mygroup.myapp,processorarchitecture = ia64,version = 2.0.22.1,type = win32,language = neutral =中性

和一个额外的清单文件,

 <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
      <application> 
         <!-- Windows 10 --> 
         <maxversiontested Id="10.0.19041.0"/>
         <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
      </application> 
   </compatibility>


   
     <!-- Windows 10 --> 
     
     
   

任何人都可以告诉我我如何找出Windows 10在Windows 8兼容模式下运行此EXE的原因,当它以Windows 10 exe的身份运行时。非常感谢。

我尝试通过打开VS2019中的EXE来检查嵌入式清单,以验证我实际上添加的信息是否确实显示。我尝试使清单文件未嵌入,这没有区别。

I am using VS2019 (16.11.10) and have created a C++ exe using Windows SDK 10.0.19041.0. When I look at the properties of the exe in Windows 10 the compatibility tab appears and the troubleshooter wants to run the exe in Windows 8 compatibility mode.

I have added information to the embedded manifest using assembly identity:

MyCompany.MyGroup.MyApp, processorArchitecture=IA64, version=2.0.22.1, type=win32, language=neutral

and also an extra manifest file containing...

 <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
      <application> 
         <!-- Windows 10 --> 
         <maxversiontested Id="10.0.19041.0"/>
         <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
      </application> 
   </compatibility>


   
     <!-- Windows 10 --> 
     
     
   

Can anyone please tell me how to find out why Windows 10 wants to run this exe in Windows 8 compatibility mode, when it runs OK as a Windows 10 exe. Many thanks.

I have tried checking the embedded manifest by opening the exe in VS2019 to verify that the information I have added actually appears, it does. I have tried making the manifest file not embedded, this makes no difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

も星光 2025-01-24 13:17:56

我怀疑您的“片段”不会通过模式验证。尝试:

  1. 将一个settings.manifest添加到包含的项目:(
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
       <application>
          <!-- Windows Vista -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
          <!-- Windows 7 -->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
          <!-- Windows 8 -->
          <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
          <!-- Windows 8.1 -->
          <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
          <!-- Windows 10 / Windows 11 -->
          <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
       </application>
    </compatibility>
</assembly>

一旦您有效,请随时修剪它)

  1. 确保在项目属性中,您拥有链接器 - &gt;清单文件 - &gt;生成清单设置为“是”

(应该默认此页面以运行“ asinvoker”。如果您需要管理员权利,则在此处更改)。

  1. 在项目属性中,还确保清单工具 - &gt;输入和输出 - &gt;嵌入清单设置为“是”。

(如果需要,这也是您要设置DPI意识的地方)

请参见此博客文章

I suspect your 'snippet' isn't passing the schema validation. Try:

  1. Add a settings.manifest to your project that contains:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
       <application>
          <!-- Windows Vista -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
          <!-- Windows 7 -->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
          <!-- Windows 8 -->
          <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
          <!-- Windows 8.1 -->
          <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
          <!-- Windows 10 / Windows 11 -->
          <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
       </application>
    </compatibility>
</assembly>

(once you have it working, feel free to trim it down)

  1. Make sure in your project properties you have Linker -> Manifest File -> Generate Manifest set to "Yes"

(this page should be defaulted to run "asInvoker". If you need admin rights, you'd change it here).

  1. In the project properties, also make sure Manifest Tool -> Input and Output -> Embed Manifest is set to "Yes".

(this is also where you'd set DPI awareness if desired)

See this blog post

如此安好 2025-01-24 13:17:56

看起来您错过了 assemble 顶级标记。试试这个:

<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity type="win32"
                        name="MyCompany.MyGroup.MyApp"
                        version="2.0.22.1"
                        processorArchitecture="*" />
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <maxversiontested Id="10.0.19041.0"/>
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
        </application>
    </compatibility>
</assembly>

文档:https://learn.microsoft.com/windows/win32 /sbscs/应用程序清单

Looks like you have missed assembly top-level tag. Try this:

<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity type="win32"
                        name="MyCompany.MyGroup.MyApp"
                        version="2.0.22.1"
                        processorArchitecture="*" />
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <maxversiontested Id="10.0.19041.0"/>
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
        </application>
    </compatibility>
</assembly>

Docs: https://learn.microsoft.com/windows/win32/sbscs/application-manifests

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文