EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

App packager (MakeAppx.exe)

App packager (MakeAppx.exe) creates an app package from files on disk or extracts the files from an app package to disk. Starting with Windows 8.1, App packager also creates an app package bundle from app packages on disk or extracts the app packages from an app package bundle to disk. It is included in Microsoft Visual Studio and the Windows Software Development Kit (SDK) for Windows 8 or Windows Software Development Kit (SDK) for Windows 8.1. Visit Downloads for developers to get them.

The MakeAppx.exe tool is typically found at these locations:

  • On x86: C:\Program Files (x86)\Windows Kits\8.0\bin\x86\makeappx.exe or C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makeappx.exe
  • On x64 in two locations:
    • C:\Program Files (x86)\Windows Kits\8.0\bin\x86\makeappx.exe or C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makeappx.exe
    • C:\Program Files (x86)\Windows Kits\8.0\bin\x64\makeappx.exe or C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makeappx.exe
There is no ARM version of the tool.

Using App packager

Note  Relative paths are supported throughout the tool.

To create a package using a directory structure

Place the AppxManifest.xml in the root of a directory containing all of the payload files for your app. An identical directory structure is created for the app package, and will be available when the package is extracted at deployment time.

  1. Place all files in a single directory structure, creating subdirectories as desired.

  2. Create a valid package manifest, AppxManifest.xml, and place it in the root directory.

  3. Run this command:

    MakeAppx pack /d input_directorypath /p filepath.appx

To create a package using a mapping file

  1. Create a valid package manifest, AppxManifest.xml.

  2. Create a mapping file. The first line contains the string [Files], and the lines that follow specify the source (disk) and destination (package) paths in quoted strings.

    [Files]
    "C:\MyApp\StartPage.htm"     "default.html"
    "C:\MyApp\readme.txt"        "doc\readme.txt"
    "\\MyServer\path\icon.png"   "icon.png"
    "MyCustomManifest.xml"       "AppxManifest.xml"
    
  3. Run this command:

    MakeAppx pack /f mapping_filepath /p filepath.appx

To sign the package using SignTool

  1. Create the certificate. The publisher listed in the manifest must match the publisher subject information of the signing certificate. For more info about creating a signing certificate, see How to create an app package signing certificate.

  2. Run SignTool.exe to sign the package:

    SignTool sign /a /v /fd hashAlgorithm /f certFileName filepath.appx

    The hashAlgorithm must match the hash algorithm used to create the blockmap when the app was packaged. With the MakeAppx packaging utility, the default Appx blockmap hash algorithm is SHA256. Run SignTool.exe specifying SHA256 as the file digest (/fd) algorithm:

    SignTool sign /a /v /fd SHA256 /f certFileName filepath.appx

    For more info about how to sign packages, see How to sign an app package using SignTool.

To extract files from a package

  1. Run this command:

    MakeAppx unpack /p file.appx /d output_directory

  2. The unpacked package has the same structure as the installed package.

To create a package bundle using a directory structure

We use the bundle command to create an app bundle at <output bundle name> by adding all packages from <content directory> (including subfolders). If <content directory> contains a bundle manifest, AppxBundleManifest.xml, it is ignored.

  1. Place all packages in a single directory structure, creating subdirectories as desired.

  2. Run this command:

    MakeAppx bundle /d input_directorypath /p filepath.appxbundle

To create a package bundle using a mapping file

We use the bundle command to create an app bundle at <output bundle name> by adding all packages from a list of packages within <mapping file>. If <mapping file> contains a bundle manifest, AppxBundleManifest.xml, it is ignored.

  1. Create a <mapping file>. The first line contains the string [Files], and the lines that follow specify the packages to add to the bundle. Each package is described by a pair of paths in quotation marks, separated by spaces or tabs. The pair of paths represents the package's source (on disk) and destination (in bundle). All destination package names must have the .appx extension.

    
        [Files]
        "C:\MyApp\MyApp_x86.appx"                 "MyApp_x86.appx"
        "C:\Program Files (x86)\ResPack.appx"    "resources\resPack.appx"
        "\\MyServer\path\ResPack.appx"           "Respack.appx"
        "my app files\respack.appx"              "my app files\respack.appx"
    
    
  2. Run this command:

    MakeAppx bundle /f mapping_filepath /p filepath.appxbundle

To extract packages from a bundle

  1. Run this command:

    MakeAppx unbundle /p bundle_name.appxbundle /d output_directory

  2. The unpacked bundle has the same structure as the installed package bundle.

Usage

The command line argument /p is always required, with either /d or /f. Note that /d and /f are mutually exclusive.

MakeAppx pack [options] /p <output package name>/d <content directory>

MakeAppx pack [options] /p <output package name>/f <mapping file>

MakeAppx unpack [options] /p <input package name>/d <output directory>

MakeAppx bundle [options] /p <output bundle name>/d <content directory>

MakeAppx bundle [options] /p <output bundle name>/f <mapping file>

MakeAppx unbundle [options] /p <input bundle name>/d <output directory>

Command-line Syntax

Here is the command-line common usage syntax for MakeAppx.

MakeAppx [pack|unpack|bundle|unbundle] [/h /l /o /no /nv /v /pfn]

MakeAppx packs or unpacks the files in a package or bundles or unbundles the packages in a bundle in the specified input directory or mapping file. Here is the list of parameters that apply to MakeAppx pack, MakeAppx unpack, MakeAppx bundle, or MakeAppx unbundle.

/l

This option is used for localized packages. The default validation trips on localized packages. This option disables only that specific validation, without requiring that all validation be disabled.

/o

Overwrite the output file if it exists. If you don't specify this option or the /no option, the user is asked whether they want to overwrite the file.

You can't use this option with /no.

/no

Prevents an overwrite of the output file if it exists. If you don't specify this option or the /o option, the user is asked whether they want to overwrite the file.

You can't use this option with /o.

/nv

Skip semantic validation. If you don't specify this option, the tool performs a full validation of the package.

/v

Enable verbose logging output to the console.

MakeAppx pack , MakeAppx unpack , MakeAppx bundle, and MakeAppx unbundle are mutually exclusive commands. Here are the command-line parameters that apply specifically to each command:

MakeAppx pack [h]

Creates a package.

/h algorithm

Specifies the hash algorithm to use when creating the block map. Here are valid values for algorithm:

SHA256 (default)
SHA384
SHA512

You can't use this option with the unpack command.

MakeAppx unpack [pfn]

Extracts all files in the specified package to the specified output directory. The output has the same directory structure as the package.

/pfn

Specifies a directory named with the package full name. This directory is created under the provided output location. You can't use this option with the pack command.

MakeAppx unbundle [pfn]

Unpacks all packages to a subdirectory under the specified output path, named after the bundle full name. The output has the same directory structure as the installed package bundle.

/pfn

Specifies a directory named with the package bundle full name. This directory is created under the provided output location. You can't use this option with the bundle command.

Semantic validation performed by MakeAppx

MakeAppx performs limited semantic validation that is designed to catch the most common deployment errors and help ensure that the app package is valid.

This validation ensures that:

  • All files referenced in the package manifest are included in the app package.
  • An application does not have two identical keys.
  • An application does not register for a forbidden protocol from this list: SMB , FILE, MS-WWA-WEB, MS-WWA.

This semantic validation is not complete, and packages built by MakeAppx are not guaranteed to be installable.

Related topics

Packaging your app using Visual Studio
Preparing your app for the Windows Store

 

 

표시:
© 2014 Microsoft. All rights reserved.