用命令行转换Conversion with the command line

使用脚本自动将 Windows 安装程序转换为 .MSIX 包Automate conversion of Windows installers to MSIX packages using scripts

.MSIX 打包工具支持用于创建 .MSIX 应用程序包的命令行界面。The MSIX Packaging Tool supports a command line interface for creating MSIX application packages. 这样,你便可以自动执行将应用安装程序重新打包的过程并执行批量转换。This enables you to automate the process of repackaging app installers and perform bulk conversions.

有关演示如何自动执行打包、签名、管理和分发 MSIX 包的过程的示例 PowerShell 和 Bash 脚本,请参阅 MSIX 工具包的 scripts 文件夹。For sample PowerShell and Bash scripts that demonstrate how to automate the process of packaging, signing, managing and distributing MSIX packages, see the scripts folder of the MSIX Toolkit.

在命令提示符下使用命令行Use the command line with the Command Prompt

若要为应用程序创建新的 .MSIX 包,请在管理员命令提示符窗口中运行 MsixPackagingTool.exe create-package 命令。To create a new MSIX package for your application, run the MsixPackagingTool.exe create-package command in an administrator Command prompt window.

下面是可以作为命令行自变量传递的参数:Here are the parameters that can be passed as command line arguments:

参数Parameter 描述Description
-?-? --help--help 显示帮助信息Show help information
--template--template [必需] 转换模板 XML 文件的路径,该文件包含用于此次转换的包信息和设置[required] path to the conversion template XML file containing package information and settings for this conversion
--virtualMachinePassword--virtualMachinePassword [可选] 转换环境使用的虚拟机的密码。[optional] The password for the Virtual Machine to be used for the conversion environment. 注意:模板文件必须包含 VirtualMachine 元素,并且 Settings:: AllowPromptForPassword 特性不得设置为 true。Notes: The template file must contain a VirtualMachine element and the Settings::AllowPromptForPassword attribute must not be set to true.
-v --verbose-v --verbose [可选] 在控制台中输出详细日志。[optional] Print verbose logs to the console.

例如:Examples:


    MsixPackagingTool.exe create-package --template c:\users\documents\ConversionTemplate.xml -v

    MSIXPackagingTool.exe create-package --template c:\users\documents\ConversionTemplate.xml --virtualMachinePassword pswd112893
    

备注

App-V 5.x 目前受支持,可以通过命令行转换。App-V 5.x conversion is currently supported to be converted throught the command line. 其中包括功能。This includes capabilities.

通过使用应用程序进行转换,可以通过 .MSIX 打包工具生成命令行模板文件,也可以从示例模板生成一个。You can generate a command line template file through the MSIX Packaging Tool by going through the conversion process with an application or you can build one from our sample template.