使用 .MSIX Core 部署 .MSIX 包Deploy an MSIX package with MSIX Core

.Msix Core引入了 .msix 部署来选择以前版本的 Windows。MSIX Core brings MSIX deployment to select previous versions of Windows. 首先,请确保已在目标设备上安装 .MSIX Core。To get started, first make sure that MSIX Core is installed on target device.

MSI 安装MSI installation

建议使用我们提供的 MSI 安装程序安装 .MSIX Core,因为它们会自动将 msixmgr 添加到搜索路径,并将 .MSIX 扩展与安装程序相关联。We recommend using our provided MSI installers to install MSIX Core because they automatically add msixmgr.exe to your search path and associate the MSIX extension with the installer.

你可以从我们的 "发布" 页上的 "资产" 部分下载以下特定于体系结构的 MSI 安装程序:You can download the following architecture-specific MSI installers from the Assets section on our release page:

  • msixmgrSetup-x64msixmgrSetup-x64.msi
  • msixmgrSetup-86msixmgrSetup-86.msi

备注

 确保为设备的体系结构选择了正确的安装程序。 Make sure you choose the correct installer for your device's architecture. 这会影响安装程序将存储重要文件的位置。This will impact where the installer will store important files. 根据安装程序的版本,文件的名称可能会更改。The name of the file may change based on the version of the installer.

安装证书Installing your certificate

需要对 .MSIX 包进行签名。MSIX packages are required to be signed. 安装任何 .MSIX 包之前,请确保已安装用于对包进行签名的证书。Before installing any MSIX packages, make sure you have installed the certificate you used to sign your packages. 你可以使用普通工作流从管理工具中安装证书来实现此目的。You can do this using you normal workflows for installing certificate from your management tool.

如果要手动安装证书,可以从提升的命令提示符运行以下命令:If you want to manually install a certificate you can run this command from an elevated command prompt:

certutil -addstore root <insert certificate.cert>

备注

 在所有情况下,应在 "受信任的根证书颁发机构" 下添加受信任的证书。 You should add your trusted certificate under Trusted Root Certification Authority in all scenarios.

使用命令行Using the Command Line

安装工具 msixmgr 后,可通过搜索、安装和删除在此计算机上管理 .MSIX 包。Once the tool msixmgr.exe is installed, it can be used to manage your MSIX packages on this machine by searching, installing, and removing. 命令行实用工具 msixmgr 适用于系统管理员。The command line utility msixmgr.exe is intended for system administrators. 在从管理员提示符运行时,它最有用。It is most useful when run from administrator prompt. 从常规命令提示符运行时,不是所有的命令都会显示在控制台上。Not all commands when run from a regular command prompt will display to the console. 有关详细信息,请参阅下方。See below for more details.

“安装”Install

使用命令提示符或 PowerShell,导航到包含 msixmgr 的目录,并运行以下命令以安装 .MSIX 包。Using command prompt or PowerShell, navigate to the directory that contains msixmgr.exe and run the following command to install your MSIX package. 也可以将 -quietUX 参数添加到命令的末尾,以使用户看不到安装程序 UI。The -quietUX parameter can also be added at the end of the command so that users don't see the installer UI.

msixmgr.exe -AddPackage C:\NotePadPlus\notepadplus.msix -quietUX

备注

 这种情况下,下面的示例使用notepadplus. .msix This and the following examples use notepadplus.msix. 这是我们的示例包之一。This is one of our sample packages.

查询特定的 .MSIX 包Querying for a specific MSIX Package

还可以通过packageFullNamepackageFamilyName和/或使用通配符搜索特定包。Searching for a specific package is possible by packageFullName, packageFamilyName and/or using wildcards as well. 支持的通配符是 * (匹配任意字符)和?(匹配单个字符)。Supported wildcards are *(match any character) and ?(match single character).

msixmgr.exe -FindPackage notepadplus_0.0.0.1_???__8wekyb3d8bbwe
msixmgr.exe -FindPackage *padplus_0.0.*
msixmgr.exe -FindPackage *epadplus_8wekyb3d8bbw?

卸载Uninstall

若要卸载,请使用以下命令:To uninstall use the following command:

msixmgr.exe -RemovePackage notepadplus_0.0.0.1_x64__8wekyb3d8bbwe -quietUX