PRI file format docs? #2828
-
Hi, @axelandrejs Are there any docs anywhere about the format of PRI files? I can see that there's extensive code in this repository for loading from them, but I couldn't find any code comments or files where the format itself is documented. And it seems that the code here is for reading PRI files but not making them - is that understanding correct? My goal is to generate a PRI file that enables the use of unplated icon assets, as Windows doesn't seem to use plated icons anymore but will still do plating by default if you don't have a PRI file. And I'd like to do it without using any Win32 or WinRT APIs. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hey! The format is not formally documented. The code to write the format is actually mostly present in MRT core - makepri.exe mostly just adds code to read the source data. That said, you don't need your own file writer to achieve what you want. How the various qualifiers, including plating are specified is described here: https://docs.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast. To achieve what you want, the best way is probably to have an asset with altform-unplated as well as one with no altform at all in your project. Makepri.exe is standalone so you can run it outside of VS or any other build system. |
Beta Was this translation helpful? Give feedback.
-
It should actually be doable to compile MRT core for other platforms. MRT core consists of three layers. The core runtime You can find the core runtime here: https://github.com/microsoft/WindowsAppSDK/tree/main/dev/MRTCore/mrt/mrm. The part related to building a PRI file is here: https://github.com/microsoft/WindowsAppSDK/tree/main/dev/MRTCore/mrt/mrm/include/mrm/build This code abstracts away platform calls to make the code portable. See https://github.com/microsoft/WindowsAppSDK/blob/main/dev/MRTCore/mrt/mrm/include/mrm/common/Platform.h. EG, we use _defcreatefile as an abstraction over CreateFile. If you implement this abstraction in your other target OS it should mostly work. I say mostly because I think in a few places direct calls might have snuck in. So there might be a bit of work. But principally, MRT core is meant to be portable at the foundational layer, which is all you need. |
Beta Was this translation helpful? Give feedback.
-
I don't actually know the details about the shell contract. @ptorr-msft do you know? |
Beta Was this translation helpful? Give feedback.
Hey!
The format is not formally documented. The code to write the format is actually mostly present in MRT core - makepri.exe mostly just adds code to read the source data.
That said, you don't need your own file writer to achieve what you want. How the various qualifiers, including plating are specified is described here: https://docs.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast.
To achieve what you want, the best way is probably to have an asset with altform-unplated as well as one with no altform at all in your project. Makepri.exe is standalone so you can run it outside of VS or any other build system.