Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
MakePri.exe memiliki sekumpulan perintah createconfig, , dump, newresourcepack, dan versioned. Topik ini merinci opsi baris perintah untuk penggunaannya.
Catatan
MakePri.exe diinstal saat Anda memeriksa opsi Windows SDK untuk Aplikasi Terkelola UWP saat menginstal Kit Pengembangan Perangkat Lunak Windows. Ini diinstal ke jalur %WindowsSdkDir%bin\<WindowsTargetPlatformVersion>\x64\makepri.exe (serta dalam folder yang dinamai untuk arsitektur lain). Contohnya,C:\Program Files (x86)\Windows Kits\10\bin\10.0.17713.0\x64\makepri.exe.
Mendapatkan bantuan dari baris perintah
Anda dapat menjalankan MakePri.exe help atau MakePri.exe /? melihat perintah yang dapat Anda gunakan dengan MakePri.exe. Anda juga dapat mengeluarkan MakePri.exe <command> /? untuk melihat secara spesifik tentang perintah dan, dalam kasus yang sangat jarang terjadi, bahkan MakePri.exe <command> <option> untuk melihat secara spesifik tentang opsi.
Perintah MakePri
C:\>makepri help
Usage:
------
MakePri.exe <command> [options]
Example:
--------
MakePri.exe new /cf C:\MyApp\priconfig.xml /pr C:\MyApp\src\ /in PackageName
Description:
------------
Creates, dumps, and performs utility functions on a PRI file. A PRI file is
an index of application resources, such as strings and image files.
Command Options:
----------------
MakePri.exe createconfig Creates a PRI config file for use with other
commands
MakePri.exe dump Dumps the contents of a PRI file
MakePri.exe new Creates a new PRI file from scratch
MakePri.exe resourcepack Creates a PRI file that contains additional
resource variants for a base PRI file
MakePri.exe versioned Creates a PRI file based on a previous version
Help:
-----
MakePri.exe help Show this help page
MakePri.exe <command> /? Shows detailed help for <command>
For example,
MakePri.exe createconfig /?
Perintah Createconfig
Perintah createconfig membuat file konfigurasi PRI baru yang diinisialisasi yang menentukan default kualifikasi yang Anda tentukan. Jalankan MakePri.exe createconfig /? untuk melihat bantuan terperinci untuk perintah ini.
C:\>makepri createconfig /?
Usage:
------
MakePri.exe createconfig /cf <config file destination> /dq
<default qualifiers> [options]
Example:
--------
MakePri.exe createconfig /cf C:\MyApp\priconfig.xml /dq lang-en-US /o /pv 10.0.0
Description:
------------
Creates a PRI configuration file at <config file destination> with default
qualifiers specified by <default qualifiers>. Multiple qualifiers are separated
by underscores (_)
Required Parameters:
--------------------
/ConfigXml(cf) : <FILEPATH> Configuration file output location
/Default(dq) : <QUALIFIERS> The default qualifiers to set in the
configuration file. A language qualifier is required
Options:
--------
/ExtensionDll(ex) : <FILEPATH> Location of the Resource Management System
environment extension DLL. This DLL must be signed by
a Microsoft-issued certificate. Default is an empty path
(no DLL will be used)
/Overwrite(o) : Overwrite an existing output file of the same name
without prompting
/Platform(pv) : <VERSION> Platform version to use for generated
configuration file
FILEPATH - a path to a file, either relative to the current
directory or absolute
QUALIFIERS - a valid qualifier token
(for example, lang-en-US_scale-100_contrast-high)
Help:
-----
/Help(h, ?) : Display the usage help text
Perintah pencadangan
Perintah dump menghasilkan file xml yang dicadangkan yang berisi daftar semua sumber daya dalam file PRI tertentu. Jalankan MakePri.exe dump /? untuk melihat bantuan terperinci untuk perintah ini.
Catatan
Paket sumber daya bebas skema adalah paket yang dibuat dengan sakelar omitSchemaFromResourcePacks dalam file konfigurasi PRI. Untuk mencadangkan paket sumber daya bebas skema, gunakan sakelar /es <main_package_PRI_file>. Jika Anda tidak menentukan file utama maka Anda akan melihat pesan kesalahan "Resources.pri dalam paket rusak sehingga enkripsi gagal (kesalahan PRI222: 0xdef0000f - Terjadi kesalahan yang tidak ditentukan)".
C:\>makepri dump /?
Usage:
------
MakePri.exe dump [options]
Example:
--------
MakePri.exe dump /if C:\MyApp\resources.pri /of C:\resources.pri.xml
Description:
------------
Outputs a dumped xml file at <output file> containing a list of all
resources in <index file>.
Options:
--------
/DumpType(dt) : <STRING> Format of the dumped file, default is
Basic
/ExtensionDll(ex) : <FILEPATH> Location of the Resource Management System
environment extension DLL. This DLL must be signed by a
Microsoft-issued certificate. Default is an empty path
(no DLL will be used)
/ExternalSchema(es) : <FILEPATH> Location of the external schema file
/IndexFile(if) : <FILEPATH> Location of the PRI file to dump from.
Default is .\resources.pri
/OutputFile(of) : <FILEPATH> Output location of the dump file, default
is .\[indexfile].xml
/OutputOptions(oo) : <OPTIONS> Options to provide detailed control over
contents of XML output files.
/Overwrite(o) : Overwrite an existing output file of the same name
without prompting
/Verbose(v) : Causes verbose messages to be output to the console
Dump Type:
Either 'Basic', 'Detailed', 'Schema', or 'Summary'
FILEPATH - a path to a file, either relative to the current
directory or absolute
Help:
-----
/Help(h, ?) : Display the usage help text
Perintah baru
Perintah new membuat file PRI baru dengan mengindeks file dalam proyek Anda seperti yang diarahkan oleh file konfigurasi Anda. Jalankan MakePri.exe new /? untuk melihat bantuan terperinci untuk perintah ini.
C:\>makepri new /?
Usage:
------
MakePri.exe new /cf <config file> /pr <project root> [options]
Example:
--------
MakePri.exe new /cf C:\MyApp\priconfig.xml /pr C:\MyApp\src\
/mn C:\MyApp\AppXManifest.xml /o /of C:\MyApp\src\resources.pri
Description:
------------
Creates a PRI file at <output file> by indexing all files in
<project root> and its subdirectories as directed by <config file>. The
index will be assigned <index name> to reference resources in the app
Required Parameters:
--------------------
/ConfigXml(cf) : <FILEPATH> Configuration file location. Use the
'Makepri.exe createconfig' command to generate one
/ProjectRoot(pr) : <FOLDERPATH> Root location of project files
Options:
--------
/AutoMerge(am) : This flag is not recommended for normal use with .appx
packages. It causes Makepri.exe to set the auto
merge flag within the PRI file. Default is not set.
/ExtensionDll(ex) : <FILEPATH> Location of the Resource Management System
environment extension DLL. This DLL must be signed by
a Microsoft-issued certificate. Default is an empty path
(no DLL will be used)
/IndexLog(il) : <FILEPATH> XML Log of indexed resources, no file
generated by default
/IndexName(in) : <STRING> Name for the generated index of resources.
Typically matches the .appx package name, class library
simple name, etc. May be supplied via the
[manifest] parameter.
/IndexOptions(io) : <OPTIONS> Options to provide detailed control over
behavior of resource indexers.
/Manifest(mn) : <FILEPATH> Location of the application or component's
manifest. This parameter is ignored if [indexname]
is given. Default is [projectroot]\AppXManifest.xml
/MappingFile(mf) : <MAPPINGFILETYPE> Generate a mapping file in the given
file format.
/OutputFile(of) : <FILEPATH> Output location of PRI file, default is
.\resources.pri
/Overwrite(o) : Overwrite an existing output file of the same name
without prompting
/ReverseMap(rm) : Generate a reverse mapping section in the PRI file
which can be used for debugging purposes.
/SchemaFile(sf) : <FILEPATH> Output location of XML resource schema
description.
/Verbose(v) : Causes verbose messages to be output to the console
/VersionMajor(vma): <INTEGER> [Deprecated] Major version number for
index, default is 1
FOLDERPATH - a path to a folder
FILEPATH - a path to a file, either relative to the current
directory or absolute
MAPPINGFILETYPE - Supported File type(s): 'AppX'
Help:
-----
/Help(h, ?) : Display the usage help text
Perintah ResourcePack
Perintah resourcepack membuat file PRI baru dengan mengindeks file dalam proyek Anda seperti yang diarahkan oleh file konfigurasi Anda. File PRI paket sumber daya hanya berisi varian sumber daya tambahan yang sudah ditentukan dalam file PRI yang ada. Jalankan MakePri.exe resourcepack /? untuk melihat bantuan terperinci untuk perintah ini.
C:\>makepri resourcepack /?
Usage:
------
MakePri.exe resourcepack /pr <project root> /cf <config file> [options]
Example:
--------
MakePri.exe resourcepack /cf C:\MyAppEs\priconfig.xml /pr C:\MyAppEs\src\
/if C:\MyApp\1.2\resources.pri /o /of C:\MyAppEs\resources.pri
Description:
------------
Creates a PRI file at <output file> by indexing all files in
<project root> and its subdirectories as directed by <config file>. A
resource pack PRI file contains only additional variants of resources
already specified in <index file>.
Required Parameters:
--------------------
/ConfigXml(cf) : <FILEPATH> Configuration file location. Use
'Makepri.exe createconfig' command to generate one
/ProjectRoot(pr) : <FOLDERPATH> Root location of project files
Options:
--------
/AutoMerge(am) : This flag is not recommended for normal use with .appx
packages. It causes Makepri.exe to set the auto
merge flag within the PRI file. By default it is set
to same as the base PRI file.
/ExtensionDll(ex) : <FILEPATH> Location of the Resource Management System
environment extension DLL. This DLL must be signed by
a Microsoft-issued certificate. Default is an empty path
(no DLL will be used)
/IndexFile(if) : <FILEPATH> Location of the base PRI or XML schema file.
Default is <ProjectRoot>\resources.pri
/IndexLog(il) : <FILEPATH> XML Log of indexed resources, no file
generated by default
/IndexOptions(io) : <OPTIONS> Options to provide detailed control over
behavior of resource indexers.
/MappingFile(mf) : <MAPPINGFILETYPE> Generate a mapping file in the given
file format.
/OutputFile(of) : <FILEPATH> Output location of PRI file, default is
.\resources.pri
/Overwrite(o) : Overwrite an existing output file of the same name
without prompting
/ReverseMap(rm) : Generate a reverse mapping section in the PRI file
which can be used for debugging purposes.
/SchemaFile(sf) : <FILEPATH> Output location of XML resource schema
description.
/Verbose(v) : Causes verbose messages to be output to the console
FOLDERPATH - a path to a folder
FILEPATH - a path to a file, either relative to the current
directory or absolute
MAPPINGFILETYPE - Supported File type(s): 'AppX'
Help:
-----
/Help(h, ?) : Display the usage help text
Perintah versi
Perintah versioned membuat file PRI versi dengan mengindeks file dalam proyek Anda seperti yang diarahkan oleh file konfigurasi Anda. Jalankan MakePri.exe versioned /? untuk melihat bantuan terperinci untuk perintah ini.
C:\>makepri versioned /?
Usage:
------
MakePri.exe versioned /cf <config file> /pr <project root> [options]
Example:
--------
MakePri.exe versioned /cf C:\MyApp\priconfig.xml /pr C:\MyApp\src
/if C:\MyApp\1.2\resources.pri /o /of C:\MyApp\src\resources.pri /o
Description:
------------
Creates a versioned PRI file at <output file> by indexing all files in
<project root> and its subdirectories as directed by <config file>.
Required Parameters:
--------------------
/ConfigXml(cf) : <FILEPATH> Configuration file location. Use
'Makepri.exe createconfig' command to generate one
/ProjectRoot(pr) : <FOLDERPATH> Root location of project files
Options:
--------
/AutoMerge(am) : This flag is not recommended for normal use with .appx
packages. It causes Makepri.exe to set the auto
merge flag within the PRI file. By default it is set
to same as the base PRI file.
/ExtensionDll(ex) : <FILEPATH> Location of the Resource Management System
environment extension DLL. This DLL must be signed by
a Microsoft-issued certificate. Default is an empty path
(no DLL will be used)
/IndexFile(if) : <FILEPATH> Location of the base PRI or XML schema file
to version from. Default is <ProjectRoot>\resources.pri
/IndexLog(il) : <FILEPATH> XML Log of indexed resources, no file
generated by default
/IndexOptions(io) : <OPTIONS> Options to provide detailed control over
behavior of resource indexers.
/MappingFile(mf) : <MAPPINGFILETYPE> Generate a mapping file in the given
file format.
/OutputFile(of) : <FILEPATH> Output location of PRI file, default is
[current directory]\resources.pri
/Overwrite(o) : Overwrite an existing output file of the same name
without prompting
/ReverseMap(rm) : Generate a reverse mapping section in the PRI file
which can be used for debugging purposes.
/SchemaFile(sf) : <FILEPATH> Output location of XML resource schema
description.
/Verbose(v) : Causes verbose messages to be output to the console
FOLDERPATH - a path to a folder
FILEPATH - a path to a file, either relative to the current
directory or absolute
MAPPINGFILETYPE - Supported File type(s): 'AppX'
Help:
-----
/Help(h, ?) : Display the usage help text
/ExtensionDll(ex)
Anda menggunakan opsi DLL ekstensi (/ex) dengan createconfig, , dumpnew, resourcepack, dan versioned untuk menentukan lokasi DLL ekstensi lingkungan Sistem Manajemen Sumber Daya.
File pengelogan/metadata
MakePri dapat menyertakan info khusus untuk paket sumber daya dalam file metadata pengindeks. Berikut adalah contoh file log untuk resources.pri dengan file german.pri PRI sumber daya dan highresolution.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-200" src="" type="Path">
<value>logo.scale-200.jpg</value>
</instance>
</package>
</root>
Opsi /IndexFile(if)
Anda menggunakan opsi file indeks (/if) dengan dump, , resourcepackdan versioned untuk menentukan file PRI input.
Untuk resourcepack dan versioned, alih-alih menyediakan file PRI sebagai parameter input untuk /IndexFile(if), Anda dapat menyediakan file skema.
/IndexFile(if) <FILEPATH>
FILEPATH adalah token yang menentukan lokasi file PRI input atau file skema PRI.
Opsi /IndexOptions(io)
Anda menggunakan opsi opsi indeks (/io) dengan new, resourcepack, dan versioned untuk menentukan opsi yang memberikan kontrol terperinci atas perilaku pengindeks sumber daya. Opsi indeks dinonaktifkan secara default.
/IndexOptions(io) <OPTIONS>
OPTIONS adalah daftar yang dipisahkan koma yang terdiri dari opsi berikut.
- +/-HiddenFiles(hf). Indeks (+) atau abaikan (-) file dan folder tersembunyi.
- +/-LinkedFiles(lf). Indeks (+) atau abaikan (-) file dan folder tertaut.
Opsi /MappingFile(mf)
Anda menggunakan opsi file pemetaan (/mf) dengan new, , resourcepackdan versioned untuk menghasilkan file pemetaan. MakeAppx.exe menggunakan file pemetaan untuk menghasilkan paket aplikasi.
/MappingFile(mf) <MAPPINGFILETYPE>
MAPPINGFILETYPE adalah token yang menentukan format file pemetaan. Satu-satunya format yang didukung yang valid adalah appx.
/mf appx
Ini adalah contoh konten file pemetaan utama.
"ResourceDimensions" "language-de-de"
Dan ini adalah contoh konten file pemetaan paket sumber daya.
"ResourceId" "Resources184.la5decaf08"
"ResourceDimensions" "language-de-de"
Ringkasan output
Jika paket sumber daya dibuat, ringkasan output dari MakePRI.exe memiliki bentuk yang lebih verbose. Berikut adalah contoh.
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
Opsi /Overwrite(o)
Jika opsi tulis berlebihan (/o) tidak disediakan, dan file output yang ditentukan sudah ada, maka MakePri.exe memerlukan konfirmasi sebelum menimpa.
Following file(s) already exist at output location:
<file(s)>
Overwrite these file(s)? [Y]es (any other key to cancel):
Opsi /OutputFile(of)
Anda menggunakan opsi file output (/of) dengan dump, , newresourcepack, dan versioned untuk menentukan lokasi output dan nama file PRI yang akan dihasilkan. Jika MakePri.exe menghasilkan lebih dari satu file PRI sumber daya, file PRI menempatkannya di folder induk file target. Misalnya, jika Anda menentukan /of MyParentFolder\TargetFile.pri MakePri.exe menghasilkan dan TargetFile.scale-100.pri berdampingan TargetFile.language-en.pri TargetFile.pri di bawah ParentFolder.
Berikut adalah contoh kondisi kesalahan dan pesan kesalahan yang sesuai.
| Kondisi kesalahan | Pesan kesalahan |
|---|---|
| Nama file output sama dengan salah satu nama paket sumber daya dalam konfigurasi. | Konfigurasi Tidak Valid: Nama> paket sumber daya nama <Paket Sumber Daya tidak boleh sama dengan file <outputfilename.pri>. |
Opsi /ReverseMap(rm)
Anda menggunakan opsi peta terbalik (/rm) dengan new, resourcepack, dan versioned untuk menghasilkan bagian pemetaan terbalik dalam file PRI, yang dapat digunakan untuk penelusuran kesalahan.
Opsi /SchemaFile(sf)
Anda menggunakan opsi file skema (/sf) dengan new, resourcepack, dan versioned untuk menulis file skema di lokasi yang ditentukan.
Untuk resourcepack dan versioned, alih-alih menyediakan file PRI sebagai parameter input untuk /IndexFile(if), Anda dapat menyediakan file skema.
/SchemaFile(sf) <FILEPATH>
FILEPATH adalah token yang menentukan tempat menulis file skema.
Ini adalah contoh file skema.
<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>
/VersionMajor(vma) tidak digunakan lagi
Opsi versi utama (/vma) (untuk new perintah) tidak digunakan lagi, dan menggunakannya menghasilkan pesan peringatan ini.
'VersionMajor (vma)' input parameter has been deprecated. Please specify major version in the configuration file using 'majorVersion' attribute on 'resources' node.
Untuk memberikan nomor versi utama, gunakan atribut resources@majorVersion dalam file konfigurasi Anda.