microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.85k stars 326 forks source link

Script to convert from .rc to .resw #1002

Open jonwis opened 3 years ago

jonwis commented 3 years ago

Proposal: Migration tooling for folks who have existing .RC files

Teams and apps with existing investments in .rc style resources might want to migrate to MRT's .resw style format instead. The WindowsAppSDK should provide tooling to convert their resource descriptions to the modern format, and prescriptive guidance for how to shift their resource-consuming code from LoadResource to the modern API surface.

mqudsi commented 3 years ago

The description for .resw templates says its for text and strings; does it support images or other binary resources like the old resource formats?

axelandrejs commented 3 years ago

.resw are only for string-based types. If you want to index files, you drop them into the file system and instruct the resource compiler to pick them up by including them in the project. As an example, these files are included: https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/MrtCore/winui_desktop_packaged_app_cpp/winui_desktop_packaged_app_cpp%20(Package)/Images

By default files are included as paths relative to the app root. You can also embed them as binary content. I don't think we currently have a sample for that, we will look into adding one.

In terms of strongly typed binary resources, those are not supported. As far as MRT is concerned, binary resources are opaque blobs.

mqudsi commented 3 years ago

Thanks for the clarification.