This article is about the usage of command line interface. More information about CLI usage and how to get started can be found here: Command Line Interface (CLI) Reference
This command creates a VHD file for MSIX app attach purposes (requires MSIX Hero 1.0.14 or newer).
Note: This command must be executed by a local administrator. Otherwise, an error will be returned when trying to execute it.
The command has the following syntax:
MSIXHeroCLI.exe appattach --directory <path-where-to-extract> --package <package-to-be-converted> [--name <filename>] [--size <maximum-vhd-size>] [--createScripts] [--extractCert] [--fileType <vhd|vhdx|cim>]
You can also use shorter form of arguments.
MSIXHeroCLI.exe appattach -d <path-where-to-extract> -p <package-to-be-converted> [-n <filename>] [-s <maximum-vhd-size>] [-c] [-e]
MSIXHeroCLI.exe appattach --directory "c:\vhd" --package "c:\download\msix-hero-188.8.131.52.msix" --createScripts MSIXHeroCLI.exe appattach --directory "c:\vhd" --package "c:\download\msix-hero-184.108.40.206.msix" --createScripts --extractCert MSIXHeroCLI.exe appattach --directory "c:\vhd" --package "c:\download\msix-hero-220.127.116.11.msix" --name "msix-hero" --size 100 MSIXHeroCLI.exe appattach -d "c:\vhd" -p "c:\download\msix-hero-18.104.22.168.msix" -c --fileType cim MSIXHeroCLI.exe appattach -d "c:\vhd" -p "c:\download\msix-hero-22.214.171.124.msix" -c -e MSIXHeroCLI.exe appattach -d "c:\vhd" -p "c:\download\msix-hero-126.96.36.199.msix" -n "msix-hero" -s 100
-p) are required.
--package supports multiple values, separated by space.
The following parameters are optional:
- –createScripts (shorthand -c)
When defined, sample scripts for app attach (registering, staging, de-staging and de-registering) will be created and saved together in the directory, specified by the
-d) switch. Four scripts will be created:
- –fileType <vhd|vhdx|cim>
Declares the output format. The default value is VHD. This parameter is available in MSIX Hero 2.2 and newer.
- –extractCert (shorthand -e)
When defined, the digital certificate will be extracted from the MSIX package and put in the directory, specified by the
-d) switch. The name of the file will be the same as the name of the MSIX file or as the value of the optional parameter
- –size <#> (shorthand -s <#>)
Specifies the maximum dynamic size of VHD disk. If not set, MSIX Hero uses an optimal size, which ensures that the package fits and has a reasonable buffer. The size specified by this parameter should be expressed in megabytes. If you provide a value lower than the total size of expanded files, an error will be returned.
- –name <X> (shorthand -n <X>)
By default, the names of the VHD file and the extracted certificate file (if switch
-ewas used) are equal to the name of the MSIX package. By providing this optional parameter you can choose the name you want.
The result of execution is an VHD (expanded package) and depending on the option other files. The program returns the following exit codes:
|0||VHD has been created.|
|2-10||Invalid parameters or other command-line related errors.|
|11||The program must be started by a local administrator.|
|<any other>||Any other error or win32 error code.|