在谷歌搜索了太多让我头晕目眩的信息和一堆误导性和矛盾的信息之后,我成功地为应用程序 list 编译了以下最小"template",它应该定义以下内容:
- 程序版本和名称
- 它不需要任何特殊的管理员权限
- 它与 Windows Vista 至 Windows 8.1 兼容
- 它具有 DPI 意识
我的 list 文件是否足以实现上述目的?我是否犯了任何需要注意的错误?我对 xmlns 命名空间版本以及它们在该 list 的某些部分不同的原因特别感到困惑?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32"
name="Manufacturer.Division.ApplicationName"
version="1.2.3.4"
processorArchitecture="x86"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- The application supports Windows Vista and Windows Server 2008 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- The application supports Windows 7 and Windows Server 2008 R2 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- The application supports Windows 8 and Windows Server 2012 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- The application supports Windows 8.1 and Windows Server 2012 R2 -->
</application>
</compatibility>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
编辑:这是我的最终 list 文件模板,它基于此处的帮助以及 future Google 员工的进一步研究。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32"
processorArchitecture="*"
version="1.2.3.4"
name="Manufacturer.Division.ApplicationName"
/>
<description>My Application Description</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Windows Vista and Windows Server 2008 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- Windows 7 and Windows Server 2008 R2 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- Windows 8 and Windows Server 2012 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- Windows 8.1 and Windows Server 2012 R2 -->
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
</windowsSettings>
</application>
</assembly>
编辑 2019:对于 DPI 感知 V2,需要进行如下所述的更改:
所以这部分发生变化:
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> <!-- fallback for Windows 7 and 8 -->
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness> <!-- falls back to per-monitor if per-monitor v2 is not supported -->
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling> <!-- enables GDI DPI scaling (if needed, otherwise leave out) -->
</windowsSettings>
</application>
最佳答案
如果您想启用 Visual Styles,则您的 list 未启用 ComCtrl v6 :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- your assemblyIdentity element ... -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<!-- your trustInfo, compatibility, application elements ... -->
</assembly>
您不需要在顶级 assemble
元素上声明 xmlns:asmv3
,因为它是在 application
上重新声明的> 元素。
所使用的 XML 命名空间不同,因为它们是由不同的 API 定义的。 list 文件不是单个 API,它是在集中位置控制的多个 API 的值的集合。
关于delphi - C++ Builder/Delphi 2010 应用程序 list 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25536779/