desktop6:CustomInstall

使桌面应用程序能够指定随桌面应用程序一起安装的一个或多个附加安装程序文件 (.exe 或 .msi) 。 例如,这对于捆绑第三方可再发行组件的应用很有用。

注意

此元素目前仅供 Microsoft 和我们的合作伙伴发布的某些类型的桌面电脑游戏使用。 它需要 customInstallActions受限功能

元素层次结构

<包>

    <扩展>

         <desktop6:Extension>

              <desktop6:CustomInstall>

语法

<desktop6:CustomInstall
  Folder = 'A string with a value between 1 and 256 characters in length that cannot contain these characters: <, >, :, ", |, ?, or *.' 
  desktop8:RunAsUser = 'An optional boolean value.'>

  <!-- Child elements -->
  desktop6:InstallActions
  desktop6:RepairActions
  desktop6:UninstallActions?

</desktop6:CustomInstall>

密钥

? 可选 (零个或一个)

特性和元素

属性

属性 说明 数据类型 必须 默认值
文件夹 包文件夹的名称,其中包含所有自定义操作所需的所有文件。 此文件夹可能包含子文件夹。 值长度介于 1 到 256 个字符之间的字符串,不能包含以下字符:<>:"|?、 或 *

子元素

子元素 描述
InstallActions 指定在首次启动桌面应用程序之前运行的安装程序文件。
RepairActions 指定当用户在桌面应用程序的“设置”页中选择修复或重置选项时运行的安装程序文件。
UninstallActions 指定在用户卸载桌面应用程序时运行的安装程序文件。

父元素

父元素 描述
desktop6:Extension 声明桌面应用程序的扩展点。
desktop8:RunAsUser 指示任务是否应以当前用户身份运行。

注解

此元素需要 customInstallActions受限功能

OS 使用 Namedesktop6:InstallActiondesktop6:RepairActiondesktop6:UninstallAction 元素的 属性来标识一组相关的安装、修复和卸载操作。 若要指定应彼此一起执行的一组相关操作,请确保它们具有相同 Name 的属性值。 仅当相应的安装或修复操作已运行时,OS 才会运行卸载操作。

示例

<Package
  xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="rescap desktop6">

  <!-- ... -->
  <!-- Other entries omitted for brevity. -->
  <!-- ... -->

  <Extensions>
    <desktop6:Extension Category="windows.customInstall">
      <desktop6:CustomInstall Folder="MyInstallers">
        <desktop6:InstallActions>
          <desktop6:InstallAction File="Setup_AntiCheat.exe" Name="AC_1" Arguments="/add /silent" />
        </desktop6:InstallActions>
        <desktop6:RepairActions>
          <desktop6:RepairAction File="Setup_AntiCheat.exe" Name="AC_1" Arguments="/add /silent /force" />
        </desktop6:RepairActions>
        <desktop6:UninstallActions>
          <desktop6:UninstallAction File="Setup_AntiCheat.exe" Name="AC_1" Arguments="/remove /silent" />
        </desktop6:UninstallActions>
      </desktop6:CustomInstall>
    </desktop6:Extension>
  </Extensions>

  <Capabilities>
    <rescap:Capability Name="customInstallActions"/>
  </Capabilities>
</Package>

要求

命名空间 http://schemas.microsoft.com/appx/manifest/desktop/windows10/6
Minimum OS Version Windows 10版本 1903 (内部版本 18362)