microsoft / microsoft/WindowsAppSDK

Feature proposal:Hope to read Pri file resource content from stream

Open
#5,068 0 comments 0 reactions 0 assignees View on GitHub
area-MRTCore feature proposal
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

Feature proposal:Hope to read ```Pri``` file resource content from stream

##### ----------------------------------

希望能从流中读取 ```Pri``` 文件的信息

----------------------------------

![Image](https://github.com/user-attachments/assets/a42ec2a0-4874-4cdd-b82a-6daf91b3604f)

Currently, the resource content of the ```Pri``` file can be read through the specific file path. However, in some scenarios, when the ```appxpackaging.h``` API is used to parse an application package, the ```IStream``` corresponding to ```resources.pri``` in the installation package can be obtained. The ```ResourceLoader``` of ```WASDK``` does not have a corresponding read method.

##### ----------------------------------

目前读取 ```Pri``` 文件的资源内容可以通过具体的文件路径读取。但在一些场景中,使用 ```appxpackaging.h``` 下的 ```API``` 解析应用包时,可以获取安装包里 ```resources.pri``` 对应的 ```IStream```,```WASDK``` 的 ```ResourceLoader``` 并没有对应的读取方法,希望能添加类似的实现。

----------------------------------

```appxpackaging.h API```:https://learn.microsoft.com/windows/win32/api/appxpackaging/
```Win32 IStream```:https://learn.microsoft.com/windows/win32/stg/istream-compound-file-implementation
```ResourceLoader```:https://learn.microsoft.com/zh-cn/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourceloader.-ctor?view=windows-app-sdk-1.6#microsoft-windows-applicationmodel-resources-resourceloader-ctor(system-string-system-string)

----------------------------------

### Steps to reproduce the bug

See description

### Expected behavior

See description

### Screenshots

See description

### NuGet package version

Windows App SDK 1.6.3: 1.6.250108002

### Packaging type

Packaged (MSIX)

### Windows version

Windows 11 version 24H2 (22621, October 2024 Update)

### IDE

Visual Studio 2022

### Additional context

None

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ResourceLoader API and the appxpackaging.h/IStream scenario described in the issue, comparing it with the existing path-based PRI loading. Done means ResourceLoader can obtain resource content from a resources.pri IStream for the described packaged-app case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.