ClickOnce 应用程序清单

ClickOnce 应用程序清单是一个 XML 文件,用于描述使用 ClickOnce 部署的应用程序。

ClickOnce 应用程序清单具有下列元素和属性。

元素 说明 属性
<assembly> 元素 必需。 顶级元素。 manifestVersion
<assemblyIdentity> 元素 必需。 标识 ClickOnce 应用程序的主程序集。 name

version

publicKeyToken

processorArchitecture

language
<trustInfo> 元素 标识应用程序安全性要求。
<entryPoint> 元素 必需。 标识应用程序代码入口点。 name
<dependency> 元素 必需。 标识应用程序运行所需的每个依赖项。 (可选)标识需要进行预安装的程序集。
<file> 元素 可选。 标识应用程序使用的每个非程序集文件。 可以包括与文件关联的组件对象模型 (COM) 隔离数据。 name

size

group

optional

writeableType
<fileAssociation> 元素 可选。 标识要与应用程序关联的文件扩展名。 extension

description

progid

defaultIcon

备注

ClickOnce 应用程序清单文件标识使用 ClickOnce 部署的应用程序。 有关 ClickOnce 的详细信息,请参阅 ClickOnce 安全和部署

文件位置

ClickOnce 应用程序清单特定于单一版本的部署。 为此,应用程序清单应与部署清单分开存储。 常见的约定是将它们放在一个子目录中,该子目录以关联版本命名。

应用程序清单始终必须在部署之前进行签名。 如果手动更改应用程序清单,则必须使用 mage.exe 对应用程序清单进行重新签名、更新部署清单,然后对部署清单进行重新签名。 有关详细信息,请参阅演练:手动部署 ClickOnce 应用程序

文件名语法

ClickOnce 应用程序清单文件的名称应为应用程序的完整名称和扩展名,如 assemblyIdentity 元素中所标识的那样,后跟扩展名 .manifest。 例如,引用 Example.exe 应用程序的应用程序清单将使用以下文件名语法。

example.exe.manifest

示例

下面的代码示例展示 ClickOnce 应用程序的应用程序清单。

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
  <asmv1:assemblyIdentity name="My Application Deployment.exe" version="1.0.0.0" publicKeyToken="43cb1e8e7a352766" language="neutral" processorArchitecture="x86" type="win32" />
  <application />
  <entryPoint>
    <assemblyIdentity name="MyApplication" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
    <commandLine file="MyApplication.exe" parameters="" />
  </entryPoint>
  <trustInfo>
    <security>
      <applicationRequestMinimum>
        <PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!--
          UAC Manifest Options
          If you want to change the Windows User Account Control level replace the
          requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

         If you want to utilize File and Registry Virtualization for backward
         compatibility then delete the requestedExecutionLevel node.
    -->
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentOS>
      <osVersionInfo>
        <os majorVersion="4" minorVersion="10" buildNumber="0" servicePackMajor="0" />
      </osVersionInfo>
    </dependentOS>
  </dependency>
  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
      <assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.20506.0" />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MyApplication.exe" size="4096">
      <assemblyIdentity name="MyApplication" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
      <hash>
        <dsig:Transforms>
          <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
        </dsig:Transforms>
        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
        <dsig:DigestValue>DpTW7RzS9IeT/RBSLj54vfTEzNg=</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>
<publisherIdentity name="CN=DOMAINCONTROLLER\UserMe" issuerKeyHash="18312a18a21b215ecf4cdb20f5a0e0b0dd263c08" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#">
...
</Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>

另请参阅