2014-08-27 79 views
3

经过Google的搜索以及一些误导和矛盾的信息之后,我设法编译了以下应用程序清单的最低“模板”以下内容:C++ Builder/Delphi 2010应用程序清单模板

  • 程序版本和名称
  • ,它不需要任何特殊的管理员权限
  • ,这是与Windows Vista到Windows 8.1
  • ,这是DPI知道
  • 01兼容

我的清单文件是否足以满足上述目的,是否有我犯过的错误,我应该知道?我特别被xmlns命名空间版本困惑,以及它们为什么与这个清单的某些部分不同?

<?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> 

编辑:这是基于这里的帮助和对未来的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> 
+0

+1包括最终清单,思考未来谷歌 - 谢谢。 – 2014-08-28 10:30:57

回答

5

您的清单没有使ComCtrl V6如果要启用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> 

你不需要顶级assembly元件上的xmlns:asmv3声明,因为它正在重新申报在application元素上。

正在使用的XML名称空间不同,因为它们是由不同的API定义的。清单文件不是单个API,它是多个API在集中位置受控的值的集合。

+0

谢谢,这是一些非常有用的补充。 – Coder12345 2014-08-27 23:34:21