desktop6:UninstallAction

指定在用户卸载桌面应用程序时运行的安装程序文件 (.exe.msi) 。

注意

此元素目前仅供打包在 MSIXVC 容器中的桌面电脑游戏使用。 它需要 customInstallActions受限功能

元素层次结构

<包>

    <扩展>

         <desktop6:Extension>

              <desktop6:CustomInstall>

                   <desktop6:UninstallActions>

                        <desktop6:UninstallAction>

语法

<desktop6:UninstallAction
  File = 'A string with a value between 1 and 256 characters in length that cannot contain these characters: <, >, :, ", |, ?, or *.'
  Name = 'A string with a value between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.'
  Arguments = 'A string with a value between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.' />

特性和元素

属性

属性 说明 数据类型 必须 默认值
File 要执行 (.exe 或 .msi) 的文件的名称。 此文件必须存在于包中。 可以指定相对于 desktop6 的 Folder 属性的路径 。CustomInstall 元素。 不能指定绝对路径,并且相对路径不得以 \ 字符开头。 值长度介于 1 到 256 个字符之间的字符串,不能包含以下字符:<>:"|?、 或 *
名称 卸载操作的名称。 此名称用于标识卸载操作,操作系统使用此名称跟踪已成功执行的操作。 确保此值与要作为同一序列的一部分运行的相应 desktop6:InstallActiondesktop6:RepairAction 元素的 属性匹配Name。 此名称在父 desktop6:UninstallActions 元素中必须是唯一的,但它可由 desktop6:InstallActions 和 desktop6:RepairActions 元素下的其他操作共享。 值长度介于 1 到 32767 个字符之间的字符串,开头和结尾处有一个非空格字符。
参数 要传递给安装程序文件的可选参数。 值长度介于 1 到 32767 个字符之间的字符串,开头和结尾处有一个非空格字符。

子元素

父元素

父元素 描述
desktop6:UninstallActions 指定在用户卸载桌面应用程序时运行的安装程序文件 (.exe 或 .msi) 。

注解

此元素需要 customInstallActions受限功能

示例

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