C ++ Builder / Delphi 2010应用程序清单模板 [英] C++ Builder / Delphi 2010 application manifest template
问题描述
在谷歌搜索之后,我的头部正在旋转和一堆误导和矛盾的信息,我设法编译了应用程序清单的以下最小模板,该模板应该定义以下内容:
- 程序版本和名称
- 不需要任何特殊的管理员权限
- 它与Windows Vista兼容Windows 8.1
- 它是DPI意识
我的清单文件是否足以满足上述目的,是否有任何错误,我应该知道?我特别对xmlns命名空间版本感到困惑,为什么它们对于这个清单的部分是不同的?
<?xml version =1.0encoding =UTF-8standalone =yes?>
< assembly manifestVersion =1.0xmlns =urn:schemas-microsoft-com:asm.v1xmlns: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 =asInvokeruiAccess =false/>
< / requestedPrivileges>
< / security>
< / trustInfo>
< compatibility xmlns =urn:schemas-microsoft-com:compatibility.v1>
< application>
< supportedOS Id ={e2011457-1546-43c5-a5fe-008deee3d3f0}/> <! - 该应用程序支持Windows Vista和Windows Server 2008 - >
< supportedOS Id ={35138b9a-5d96-4fbd-8e2d-a2440225f93a}/> <! - 该应用程序支持Windows 7和Windows Server 2008 R2 - >
< supportedOS Id ={4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}/> <! - 该应用程序支持Windows 8和Windows Server 2012 - >
< supportedOS Id ={1f676c76-80e1-4239-95bb-83d0f6d0da78}/> <! - 该应用程序支持Windows 8.1和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>
编辑:这是我的最终清单文件模板,
<?xml version =1.0encoding =UTF -8standalone =yes?>
< assembly xmlns =urn:schemas-microsoft-com:asm.v1manifestVersion =1.0>
< assemblyIdentity type =win32
processorArchitecture =*
version =1.2.3.4
name =Manufacturer.Division.ApplicationName
/>
< description>我的应用说明< / description>
<依赖关系>
< 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 =asInvokeruiAccess =false/>
< / requestedPrivileges>
< / security>
< / trustInfo>
< compatibility xmlns =urn:schemas-microsoft-com:compatibility.v1>
< application>
< supportedOS Id ={e2011457-1546-43c5-a5fe-008deee3d3f0}/> <! - Windows Vista和Windows Server 2008 - >
< supportedOS Id ={35138b9a-5d96-4fbd-8e2d-a2440225f93a}/> <! - Windows 7和Windows Server 2008 R2 - >
< supportedOS Id ={4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}/> <! - Windows 8和Windows Server 2012 - >
< supportedOS Id ={1f676c76-80e1-4239-95bb-83d0f6d0da78}/> <! - Windows 8.1和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>
您的清单不启用ComCtrl v6,启用可视样式:
<?xml version =1.0encoding =UTF-8standalone =yes?>
< assembly xmlns =urn:schemas-microsoft-com:asm.v1manifestVersion =1.0>
<! - 你的assemblyIdentity元素... - >
<依赖关系>
< dependentAssembly>
< assemblyIdentity
type =win32
name =Microsoft.Windows.Common-Controls
version =6.0.0.0
processorArchitecture =*
publicKeyToken =6595b64144ccf1df
language =*
/>
< / dependentAssembly>
< / dependency>
<! - 您的trustInfo,兼容性,应用程序元素...>
< / assembly>
您不需要 xmlns:asmv3
因为它是在应用程序
元素上重新声明的,因此它们在顶级程序集
元素上的声明。 >
正在使用的XML命名空间是不同的,因为它们由不同的API定义。清单文件不是单一的API,它是在集中位置控制的多个API的值的集合。
After googling so much that my head is spinning and a bunch of misleading and contradictory information, I've managed to compile the following minimum "template" for application manifest which is supposed to do define the following:
- program version and name
- that it does not require any special administrator privileges
- that it is compatible with Windows Vista to Windows 8.1
- that it is DPI aware
Is my manifest file sufficient for the above purpose and are there any mistakes I did, that I should be aware of? I am in particular puzzled by the xmlns namespace versions and the reason why they are different for parts of this manifest?
<?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>
Edit: Here is my final manifest file template based on help here and further research for future googlers.
<?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>
Your manifest is not enabling ComCtrl v6 if you want to enable Visual Styles:
<?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>
You do not need a xmlns:asmv3
declaration on the top-level assembly
element, since it is being re-declared on the application
element.
The XML namespaces being used are different because they are defined by different APIs. A manifest file is not a single API, it is a collection of values for multiple APIs being controlled in a centralized location.
这篇关于C ++ Builder / Delphi 2010应用程序清单模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!