Skip to content

Code Quality: Improve startup error message when Windows App Runtime …#18208

Open
workbysaran wants to merge 2 commits intofiles-community:mainfrom
workbysaran:sg/improve-startup-error-message-msrt
Open

Code Quality: Improve startup error message when Windows App Runtime …#18208
workbysaran wants to merge 2 commits intofiles-community:mainfrom
workbysaran:sg/improve-startup-error-message-msrt

Conversation

@workbysaran
Copy link
Contributor

Resolved / Related Issues
Improved the startup experience when the Windows App Runtime is missing or corrupted. Previously the app would silently terminate showing only a brief loading cursor with no feedback. The improvement catches the COM registration failure ('REGDB_E_CLASSNOTREG') on the first Windows App Runtime call, shows a user-facing error dialog and rethrows a descriptive exception so the failure is recorded in Windows Event Viewer.

Related #17763

Steps used to test these changes

  1. Install Files on a machine with the Windows App Runtime missing or corrupted
  2. Launch Files and confirm the error dialog appears with a clear message instead of a silent crash
  3. Open Event Viewer > Windows Logs > Application and confirm a descriptive entry is recorded

@yair100 yair100 added the needs - additional info Needs more information from the reporter label Feb 26, 2026
Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

Looks good, code wise.

{
// These strings are intentionally hardcoded and cannot be moved to resource files.
// The Windows App Runtime (which powers the resource loading system) may itself be unavailable at this point
public const string MissingRuntimeMessage = "Files failed to start. A required Windows component could not be loaded. Try reinstalling Files from the Microsoft Store or from https://files.community/download";
Copy link
Member

Choose a reason for hiding this comment

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

Is the link clickable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the link is not clickable. If you need a clickable link, we need to use TaskDialog instead.

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

Labels

needs - additional info Needs more information from the reporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants