Make Package (makepkg.exe)

Creates application packages and application package metadata.

makepkg command [/updcompat 1|2] [/gameos <gameos file>] [/f <file name>] [/d <content directory>] [/pd <output directory>] [/l] [/contentid <ID>] [/productid <ProductIDGUID>] [/s] [/nocrashdump] [/v] [/?]
Option Description
command Specifies the package or application command to perform.
Command Function
pack Creates a new application package from files on disk.
makepkg pack /f <mapping file> /d <content directory> /pd <output package directory> /productid <ProductIDGUID>[/l] 
Creates an app package at output package directory by adding files specified within the mapping file. For example, in order to package the contents of a directory with 3 files, a.txt, b.txt, and game.exe, the following mapping file would be used:
<Package>
  <Chunk Id="1000" Marker="Launch">
    <FileGroup DestinationPath="\" SourcePath=".\" Include="a.txt"/>
    <FileGroup DestinationPath="\" SourcePath=".\" Include="b.txt"/>
    <FileGroup DestinationPath="\" SourcePath=".\" Include="game.exe"/>
  </Chunk>
</Package>
            
The MakePkg.exe packaging tool expands the last chunk in a title's layout to meet alignment requirements. Content updates to any chunk will therefore typically cause the last chunk to change its size, and the system will redownload it. For large last chunks, this will mean a large content update download, even if the chunk's contents haven't changed. To minimize download size, exclusive resource apps must include a special alignment chunk referring to a one-byte file at the end of their layout XML file:
<Chunk Id="1073741823">
  <FileGroup DestinationPath="\" SourcePath=".\" Include="Update.AlignmentChunk"/>
</Chunk>
    
Exclusive resource apps that are missing the alignment chunk and one-byte file requirement will log a warning, which will cause a certification failure if not corrected prior to submission. See Deployment Package Schema for a description of the mapping file schema. The content directory specified must contain a valid application manifest file with the name AppxManifest.xml. The AppxManifest.xml file can be found in your application's Visual Studio project build output directory. See Application Manifest Schema for a description of the application manifest schema. By default makepkg pack encrypts the package using a well-known encryption key recognized by devkits for testing purposes. The default behavior can be overridden with the /l switch. The maximum size for the created application package is 49,900,000,000 bytes. See Application Packaging During Development and Testing Streaming Install Packages for more information on creating and testing app packages. MakePkg.exe will scan for certain files as part of your package, and move them to a special 'registration' chunk. This includes AppXManifest.xml, any images referenced within AppXManifest.xml, and Resources.pri, if present.
Note
For information about the Resources.pri file, see the Make Package Resource Index (makepri.exe) command line tool topic.
You can manually lay out these files in the layout.xml file by specifying "Registration" in the Id attribute for the chunk that contains these files.
Note
Makepkg rejects binaries that contain relocations from within executable sections. Such relocations require modifications to the executable section at load time which could enable code modifications to occur during this window. For this reason, makepkg will fail if it is presented a binary with such traits. One common way to prevent this is to avoid merging read-only data sections into another executable section when compiling your binaries.
 
appdata Creates application metadata for the package from an application manifest.
makepkg appdata /d <content directory> /pd <output directory> [/nocrashdump]
makepkg appdata /f <application manifest file> /pd <output directory> [/nocrashdump]
            
Creates application metadata for the package at output directory by processing application manifest file. If content directory is specified, a valid application manifest file must be present in that location with the name AppxManifest.xml.
Note
The appdata command is used as part of the Visual Studio application deployment process and should not be used directly.
 
validate Runs the validation steps without building the package. Steps include running Submission Validator, which generates the log file documenting possible issues with package submission. Takes the same parameters as the 'makepkg pack' command, with the exception of the mapfile being optional.
makepkg validate [options] [/f <mapfile>] /d <sourcedir> /pd <destinationdir>              
            
 
/updcompat 1|2 Used with the pack command. Specifies whether an update package has per-file granularity or per-chunk granularity. Using /updcompat 2 (or unspecified) will generate an XVC that is ready for Content Update version 2, where the update granularity is per-file. This is the default for the February 2015 XDK and later versions. Using /updcompat 1 will generate an XVC that is ready for Content Update version 1 where the update granularity is per-chunk. This was the default, prior to February 2015 XDK release. A game cannot switch between update compatibility modes once released (without causing a complete re-download of the entire title):
  • Updates to already shipped games that used the default /updcompat (prior to the February 2015 XDK) or specified /updcompat 1 should specify /updcompat 1.
  • Updates to games that shipped with /updcompat 2, or with the February 2015 XDK (or later) and accepted the default, should specify /updcompat 2.
Newly shipping games should specify /updcompat 2 or accept the default if they want to opt-in to file level content update. Games must make this opt-in decision before shipping their base XVC to retail.
/gameos <gameos file>Used with the pack command. Optional parameter that specifies the game OS file to be embedded in the package. If this parameter is not used, or no gameos file is specified, the era.xvd file is required to be in the layout directory next to the executable.
/f <file name>Specifies an input file. When used with the pack or validate commands, it specifies a mapping file. When used with the appdata command, it specifies the application manifest file.
/d <content directory>Specifies the content directory. The specified directory (such as the layout\image\loose directory for your project) must contain a valid AppxManifest.xml file.
/pd <output directory>Specifies the output directory.
/genappdataForces creation of appdata.bin for this package.
/lEncrypts the package with a content license. Used with the pack command.By default makepkg pack encrypts the package using a well-known encryption key recognized by devkits for testing purposes. The /l switch overrides the default behavior. See Application Packaging During Development for more information.
Note
When submitting a package to certification, you must use the /l unless otherwise directed to do so by the certification team.
/contentid <ID>Optional parameter that specifies the content id to which this package belongs. The ID is a GUID. If this parameter is not present or is specified with a value of 00000000-0000-0000-0000-000000000000, a random GUID will used. This parameter is not necessary when preparing builds for submission. Used with the pack command.
/productid <ProductIDGUID>Optional parameter that specifies the product id to which this package belongs. The ID is a GUID. If not present, the GUID will be 00000000-0000-0000-0000-000000000000. This parameter is not necessary when preparing builds for submission. Used with the pack command.ProductID needs to be included when enumerating DLC packages that are installed from burned discs, or when the system is running offline.
/sOptional parameter that optimizes the packaging process to achieve greater speed when run on SSD drives. This option doesn't affect the product output package itself. Used with the pack command. Note, this may actually make packaging slower on non-SSD or low performance SSD drives.
/nocrashdumpSpecifies that the application opts out of automatic generation and upload of crashdumps in case of a fault.
/symbolpathsAllows specifying additional paths for symbol resolution lookup during the symbol bundling. The paths should be specified as a semicolon delimited list.
/skipsymbolbundlingSpecifies that the symbol bundling step should be skipped. Use of this flag is not recommended.
/skipcudiffSpecifies that the generation of a CuDiff file should be skipped. Use of this flag is not recommended for builds which may be submitted to certification but it can speed up local iteration times.
/skipvalidationSpecifies that the validation step should be skipped. No submission validator log file will be generated when using this flag. Use of this flag is not recommended for builds which may be submitted to certification but it can speed up local iteration times.
/validationcriticalSpecifies that failures in submission validator should be treated as critical failures for the MakePkg process.
/vEnables verbose output to the console.
/?Displays help.

Remarks

When makepkg pack is run, a set of validation tests is performed. Depending on the size of the title and the number of files, this can take a significant amount of time. The results of the validation test are logged in an XML file in the same output directory as the app package output. The log lists all the errors that need to be corrected to pass validation. The validation tests check for common errors that historically have led to titles being delayed or later rejected from the mastering and certification process. See the Submission Validator overview for more information on the tests run by submission validator.

makepkg sets the following exit codes:

Exit Code Description
0Success
1Bad environment (kernel driver not installed / not running in elevated command prompt)
2Invalid command line
3Failed to build output

More extensive information is also output to stderr.

Note

Some antivirus software and other software packages which install file system filters can interfere with the operation of makepkg. If makepkg returns error 0x800700ea, please run the following command from a command prompt launched with administrator privilleges:

fltmc filters  

The following entries are expected, and do not interfere with makepkg:

  • MpFilter
  • luafv
  • npsvctrig
  • FileInfo

If you see any entries other than this, please contact your DAM or the XGD forum with the list of entries and your packaging steps.

Content Update System Versions

The older Content Update system (Content Update v1 below) used a very coarse-grained algorithm for detecting and applying the changes between two XVC files. The unit of replacement is called a Chunk, and it corresponds directly to a section in the layout.xml file specified by the developer when packaging their XVC.

Content Update v2 will allow for changes to specific data sections within a chunk without having to re-download the entire chunk.

Both versions of content update are still available to use when creating a package. See /updcompat 1|2 for details.

A comparison of the two versions of Content Update:

Content Update v1 (chunk granular) Content Update v2 (file granular)
When any byte in a chunk is modified, the entire chunk must be re-downloaded.When any byte in a file is modified, the entire file must be re-downloaded.
During update download, any chunks that were modified are unavailable to the title until after the chunk is re-streamed.During update download, any chunks that have modified files are unavailable to the title until after all modified files within the chunk are re-streamed.
The hash tree related to any chunk that was modified or added will be re-downloaded prior to the chunk's download.The hash tree related to any chunk that had modified or added files will be re-downloaded in its entirety prior to the chunk's files' download. (May be transparently optimized in the future by the platform.)
When a chunk is modified or added, the chunk may be fragmented elsewhere on the HDD relative to the rest of the package. The modified chunk itself will generally not be fragmented.When a file is modified or added, the file may be fragmented elsewhere on the HDD relative to the rest of the chunk and package. The modified file itself will generally not be fragmented.
No file limit.Recommended maximum of 100,000 files per chunk.
Enable by adding /updcompat 1 to makepkg.Enabled by default or adding /updcompat 2 to makepkg.

Note Once a package has shipped to retail customers it must not change between content update compatibility modes as that causes a complete re-download of the entire package. Please ensure that any updates to a title match the Content Update system of the base XVC for the title. The Packageutil info <xvc-file> command will give you information about a package, including whether it’s a CUv1 or CUv2 package.

See also

Application Packaging During Development

Testing Streaming Install Packages

Deployment Package Schema

Make Package Resource Index (makepri.exe)