desktop6:RepairAction

指定当用户在桌面应用程序的“设置”页中选择修复或重置选项时运行的安装程序文件(.exe 或 .msi)。

注意

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

元素层次结构

<包>

     <扩展>

          <desktop6:Extension>

               <desktop6:CustomInstall>

                    <desktop6:RepairActions>

                         <desktop6:RepairAction>

语法

<desktop6:RepairAction
  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.' />

属性和元素

属性

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

子元素

没有

父元素

Parent 元素 描述
desktop6:RepairActions 指定用户在桌面应用程序的“设置”页中选择修复或重置选项时运行的安装程序文件(.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>

要求

项目 价值
Namespace http://schemas.microsoft.com/appx/manifest/desktop/windows10/6
最低 OS 版本 Windows 10 版本 1903(内部版本 18362)