0

I want to load a .pri file programmatically from a windows app package, but unfortunately the file type is in a semi binary format and is completely undocumented (thanks Microsoft). I know that there are tools out there like MakePri.exe in the windows ask, which can convert a .pri file to a readable xml. I am somewhat confused why the resource.pri in a windows uwp package isn't just stored as an xml. I have no idea how to load this file type, atleast to an xml format. I have already looked everywhere on the internet, and I am almost considering attempting to decompile the makepri.exe file to try and guess how it works. But if anyone knows literally anything that could help me, then please leave an answer.

James Gaunt
  • 119
  • 1
  • 14
  • I'm afraid we won't be able to provide anything else than already discussed here: https://stackoverflow.com/questions/14712070/is-there-a-way-to-open-read-pri-files-package-resource-index-used-in-window – Finomnis Dec 24 '22 at 09:46

1 Answers1

0

The PRI file is generated by the Resource Management System at build time. It contains an index of all the different variants of the resources that are packaged up with the UWP app. It is not designed to be loaded directly via code. If you want to access the resource from code, you need to use ResourceManager API instead. If you really want to read the PRI file, you have to use MakePri.exe to convert the PRI file into a xml file.

Roy Li - MSFT
  • 8,043
  • 1
  • 7
  • 13
  • I am aware of this feature, but I am fairly sure I cannot use that library in rust code. – James Gaunt Dec 26 '22 at 06:41
  • @JimmyGrant I'm not familiar with Rust. But generally speaking, you need to call this API in UWP project to access its own resource. – Roy Li - MSFT Dec 26 '22 at 07:11
  • @JimmyGrant If you are tying to load the PRI file out of the UWP app, as I mentioned in my answer, the file is not designed to be loaded directly. You have to convert it first using `MakePri.exe`. – Roy Li - MSFT Dec 26 '22 at 07:16