使用命令列轉換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 工具組的指令碼資料夾。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.