Skip to content

Crash in ShellOpenFile #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
levicki opened this issue Apr 3, 2025 · 1 comment
Open

Crash in ShellOpenFile #459

levicki opened this issue Apr 3, 2025 · 1 comment
Labels
Needs validation Feature is implemented and needs testing and/or feedback
Milestone

Comments

@levicki
Copy link

levicki commented Apr 3, 2025

This code is unsafe as it doesn't guard against possible exceptions.

For example, here's what happens when default system .ini file association is missing or corrupted (happens if you uninstall Notepad which is uninstallable in Windows 11):

System.ComponentModel.Win32Exception
  HResult=0x80004005
  Message=An error occurred trying to start process 'C:\PROGRAMS\MEModManager\mods\LE3\HK-47s No Pause On Focus Loss (LE3)\moddesc.ini' with working directory 'c:\PROGRAMS\MEModManager'. Application not found
  Source=<Cannot evaluate the exception source>
  StackTrace: <Cannot evaluate the exception stack trace>

To fix, wrap it in try / catch block and show a message that moddesc.ini can't be opened and inform user they should fix their .ini file association.

Mgamerz added a commit that referenced this issue Apr 5, 2025
@Mgamerz
Copy link
Member

Mgamerz commented Apr 5, 2025

Thanks for this. I just fixed this in the local codebase, so the next release (9.1) should include it, whenever I get around to shipping that. I'm going to keep this open until it ships.

@Mgamerz Mgamerz added the Needs validation Feature is implemented and needs testing and/or feedback label Apr 5, 2025
@Mgamerz Mgamerz added this to the 9.1 milestone Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs validation Feature is implemented and needs testing and/or feedback
Projects
None yet
Development

No branches or pull requests

2 participants