What's new for MakePRI.exe command options

This topic describes changes to the command options for the MakePRI.exe tool to support the resource pack generation pipeline for Windows 8.1 and later.

MakePRI.exe's command-line interface is changed to support the generation of a schema file and mapping files. Also, some of MakePRI.exe's existing flags are modified or extended to support resource pack generation.

  • Mapping file (/mf)
    • Example for mapping file
  • Schema file (/sf)
    • Example for schema file
  • Changes in logging/metadata file
    • Example of a log file
  • Changes in output file (/of)
  • Changes in index file (/if)
    • Examples for index file
  • Deprecating version major (/vma)
  • Changes to handling of overwrite
  • Changes in the output summary
  • Changes in dump command
  • Extension DLL (/ex)
    • Examples for ExtensionDll
  • Reverse map (/rm)

Mapping file (/mf)

You can now include the mapping file option (/mf) to new, resourcepack, and versioned actions to generate a mapping file. MakeAppx.exe uses the mapping file to generate app packages.

Example for mapping file

This example shows how to use /MappingFile (mf):

/MappingFile(mf)    <MAPPINGFORMAT>

MAPPINGFORMAT is a token that specifies the format of the mapping file. Currently, 'appx' is the only valid supported format. For example:

/mf appx

You can either have something like this in a resource pack map file:

"ResourceId"                           "Resources184.la5decaf08"
"ResourceDimensions"                   "language-de-de"

Or, something like this in a main map file:

"ResourceDimensions"                   "language-de-de"

Schema file (/sf)

You can now include the schema file option (/sf) to new, resourcepack, and versioned actions to write a schema file at the specified location.

Users can provide a schema file to MakePRI.exe instead of a PRI file as the input parameter for the /IndexFile (if) command-line option for resourcepack and versioned actions.

Example for schema file

This example shows how to use /SchemaFile (sf):

/SchemaFile(sf) <FILEPATH>

FILEPATH is a token that specifies where to write the schema file.

Here is an example for a schema XML file:

<PriInfo>
    <ResourceMap name=”IndexName” resourceVersion=”1.0”> 
        <ResourceMapSubtree name=”Resources” index=”1”>
            <NamedResource name=”String1” index=”1”/>
            <NamedResource name=”String2” index=”1”/>
        </ResourceMapSubtree>
        <ResourceMapSubtree name=”Files” index=”2”>
            <NamedResource name=”logo.png” index=”2”/>
            <ResourceMapSubtree name=”images” index=”3”>
                <NamedResource name=”success.png” index=”3”/>
                <NamedResource name=”error.png” index=”3”/>
            </ResourceMapSubtree>
        </ResourceMapSubtree>
    </ResourceMap>
</PriInfo>

Changes in logging/metadata file

MakePRI.exe modifies the indexer metadata file to display info specific to a resource pack. The format of the metadata file is unchanged from Windows 8 if no resource packs are generated (that is, the packaging section is absent from the configuration).

Example of a log file

Here is an example of a log file for resources.pri with resource PRI files: german.pri and highres.pri.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
  <package filename="resources.pri">
    <instance itemname="Files\logo.jpg" qualifiers="Scale-100" src="" type="Path">
      <value>logo.scale-100.jpg</value>
    </instance>
    <instance itemname="resources\string2" qualifiers="Language-en-us" src="C:\Users\alias\Desktop\repro\app4\project\en-us\resources.resw" type="String">
      <value>value2</value>
    </instance>
    <instance itemname="resources\string1" qualifiers="Language-en-us" src="C:\Users\alias\Desktop\repro\app4\project\en-us\resources.resw" type="String">
      <value>value1</value>
    </instance>
  </package>
  <package filename="german.pri">
    <instance itemname="resources\string2" qualifiers="Language-de-de" src="C:\Users\alias\Desktop\repro\app4\project\de-de\resources.resw" type="String">
      <value>value2</value>
    </instance>
    <instance itemname="resources\string1" qualifiers="Language-de-de" src="C:\Users\alias\Desktop\repro\app4\project\de-de\resources.resw" type="String">
      <value>value1</value>
    </instance>
  </package>
  <package filename="highresolution.pri">
    <instance itemname="Files\logo.jpg" qualifiers="Scale-140" src="" type="Path">
      <value>logo.scale-140.jpg</value>
    </instance>
  </package>
</root>

Changes in output file (/of)

The /OutputFile (of) command-line option defines the output location and name of the PRI file to be generated. You can now get more than one resource PRI file. If MakePRI.exe generates more than one resource PRI file, it places them in the parent folder of the target file. For example, if you specify ParentFolder\TargetFile.pri for /of, MakePRI.exe generates TargetFile.language-en.pri and TargetFile.scale-100.pri alongside TargetFile.pri under ParentFolder.

Here is an error string for a particular scenario:

Scenario Error string
The output file name is the same as one of the resource pack names in the configuration. Invalid Configuration: Resource Pack name <resource pack name> cannot be same as the output file <outputfilename.pri>.

 

Changes in index file (/if)

The /IndexFile (if) command-line option takes an input PRI file. MakePRI.exe can now accept a PRI schema file too.

Examples for index file

This example show how to use /IndexFile (if) with versioned action:

Versioned:  
/IndexFile(if)  <FILEPATH>: Location of the base PRI file or XML schema file to version from. 
Default is [projectroot]\resources.pri.

This example show how to use /IndexFile (if) with resourcepack action:

ResourcePack:
/IndexFile(if)  <FILEPATH>: Location of the base PRI file or XML schema file. 
Default is [projectroot]\resources.pri.

Deprecating version major (/vma)

The /VersionMajor (vma) command-line option is deprecated for Windows 8.1 and later. Instead, use the majorVersion attribute of configuration to provide the major version number. Users get a warning message and a 'Deprecated' tag next to the option in the help message. For more info about the deprecated message, see Deprecating /vma message.

Changes to handling of overwrite

If the /Overwrite (o) option is not provided, MakePRI.exe now requests user input before it overwrites resource files at the target destination.

For example, suppose en-us.pri already exists. MakePRI.exe outputs this:

Overwrite? (y) (n) (a):

Where y = yes, n = no, a = overwrite all.

Changes in the output summary

The summary output is unchanged if the resource packs aren't created. If resource packs are created, MakePRI.exe shows a different format:

Index Pass Completed: ResourcePackTests\TestApp_ResourcePack
Language Qualifiers: fr-FR, de-DE

Finished building
Version: 1.0
Resource Map Name: AppTest
Named Resources: 11

Resource PRI: fr-FR.pri
Version: 1.0
Resource Candidates: 4
Language: fr-FR

Resource PRI: de-DE.pri
Version: 1.0
Resource Candidates: 4
Language: de-DE

Output File(s) at TempTestResults
Successfully Completed

Changes in dump command

The dump type for Windows 8.1 and later can also be 'Schema'.

The dump type is now 'Basic', 'Detailed', or 'Schema'.

Extension DLL (/ex)

You can now include the extension DLL option (/ExtensionDll(ex)) to new, createconfig, resourcepack, versioned, and dump actions to specify the location of the Resource Management System environment extension DLL.

Examples for ExtensionDll

These examples show how to use /ExtensionDll(ex).

For new:

Makepri.exe new /pr <project root> /cf <config file> /ex : <FILEPATH> Location of the MRT environment
             extension DLL. This DLL must be signed by a Microsoft-issued certificate. 
             Default is an empty path (no DLL will be used).

For createconfig:

Makepri.exe createconfig /ex : <FILEPATH> 
             

For resourcepack:

MakePri.exe resourcepack /pr <project root> /cf <config file> /ex : <FILEPATH> 

For versioned:

MakePri.exe versioned /pr <project root> /cf <config file> /ex : <FILEPATH> 

For dump:

MakePri.exe dump /ex : <FILEPATH> 

Reverse map (/rm)

You can now include the reverse map option (/ReverseMap (/rm)) to new, resourcepack, and versioned actions to generate a reverse mapping section in the PRI file, which can be used for debugging.