Skip to content

Fix two startup crashes and two failures when deleting or exporting drivers - #470

Merged
lostindark merged 5 commits into
lostindark:masterfrom
indep-arg:master
Oct 10, 2026
Merged

lostindark merged 5 commits into
lostindark:masterfrom
indep-arg:master

Conversation

@indep-arg

@indep-arg indep-arg commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

I found these while reading through the code. I was going to open them as issues, but the fixes were small, so I just fixed them. Each one is in a separate commit and touches a different file.

1. Crash on startup with a broken portable config (Program.cs)

SettingsMigration.UsePortableSettings can throw InvalidDataException (for example when Rapr.user.config is just <configuration/>). It isn't an IOException, so the filter in Main doesn't catch it and the app closes on every start. I added it to the filter, so it now falls back to the per-user settings like the other settings errors do.

2. Crash or slow start when the exe is at a drive root (DSEFormHelper.cs)

GetSupportedLanguage searched for "Rapr..resources.dll" (two dots), so it never matched anything. It still walked every folder under the exe, though, and only caught SecurityException. If you run it from D:\, it hits System Volume Information, gets UnauthorizedAccessException, and the app dies in DSEForm's static constructor. Now it only checks the direct culture subfolders and ignores access/IO errors.

3. Delete/export breaks when sorted by "Driver Files" (LinqExtensions.cs)

Before deleting or exporting, the checked items are sorted with the list's sort columns. DriverFiles is a List<string>, which isn't IComparable, so LINQ throws. To repro: show the "Driver Files" column, sort by it, check 2+ drivers, and click Delete. You get the unhandled exception dialog. Non-comparable values are now sorted by their text, the same way the column displays them. I added a few tests in RaprTests/Utils/LinqExtensionsTests.cs.

4. Exporting selected drivers stops at the first error (DSEForm.cs)

NativeDriverStore.ExportDriver throws on failure instead of returning false, and the loop didn't catch it, so one bad driver stopped the whole export. Now each driver is handled separately, the same way ExportAllDrivers already does it.

AppVeyor build passes (all 70 tests, including the new ones)

@lostindark
lostindark merged commit b823c50 into lostindark:master Oct 10, 2026
1 check passed
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.

2 participants