Skip to content

Conversation

@qiutongMS
Copy link
Collaborator

@qiutongMS qiutongMS commented Sep 22, 2025

Summary\nFixes issue where MrmGetFilePathFromName returns ERROR_FILE_NOT_FOUND in WinAppSDK 1.8 when resources.pri doesn't exist, breaking unpackaged apps and XAML islands.\n\n## Problem\nIn WinAppSDK 1.8, there was a regression where MrmGetFilePathFromName would fail when the MICROSOFT_WINDOWSAPPRUNTIME_BASE_DIRECTORY environment variable points to an invalid or inaccessible directory. This breaks unpackaged applications, particularly XAML islands that rely on resource resolution.\n\n\n[Content truncated - see issue #18 for full details]

- Added validation for MICROSOFT_WINDOWSAPPRUNTIME_BASE_DIRECTORY before use
- Function now falls back to exe path if base directory is invalid/inaccessible
- Prevents ERROR_FILE_NOT_FOUND when resources.pri doesn't exist in unpackaged scenarios
- Restores WinAppSDK 1.7 behavior for XAML islands and unpackaged apps

Fixes #18
Copy link
Owner

@haonanttt haonanttt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Comprehensive PR Review - MrmGetFilePathFromName Regression Fix

This review focuses on logic correctness and backward compatibility for the fix addressing issue #18 where MrmGetFilePathFromName returns ERROR_FILE_NOT_FOUND in WinAppSDK 1.8 when resources.pri doesn't exist, breaking unpackaged apps and XAML islands.

📋 Review Summary

  • Files reviewed: 1 (dev/MRTCore/mrt/Core/src/MRM.cpp)
  • Changes: +9/-3 lines
  • Focus areas: Functionality, performance, security, and documentation
  • Special attention: Logic correctness of fallback behavior, backward compatibility with WinAppSDK 1.7, edge case handling

🔍 Key Review Aspects Covered:

  1. Functionality - Logic correctness, edge cases, and feature completeness
  2. Performance - Efficiency, scalability, and resource utilization
  3. Security - Data protection, input validation, and vulnerability assessment
  4. Documentation - Code clarity, comments, and maintainability

The fix appears to restore the expected behavior for unpackaged applications and XAML islands that rely on resource resolution when resources.pri files don't exist, maintaining compatibility with WinAppSDK 1.7 behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants