int19h / WarBender

WarBender: a Mount & Blade: Warband save game editor
MIT License
28 stars 7 forks source link

Launch failure due to get_WarbandPath() and possibly Good Old Games #1

Closed NodusCursorius closed 6 years ago

NodusCursorius commented 6 years ago

Version: 1.0.1

Error: Silent crash. Good Old Games does not seem to include a registry addition for hklm.OpenSubKey(@"SOFTWARE\mount&blade warband"), line 71 of MainForm.cs

Additional: Attempting to run the WarBender.UI.exe binary results a crash where nothing occurs and the process immediately terminates, a silent failure. Of note, the game was installed through GOG Galaxy and after searching through registry, it appears the path for that approach is Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1207666913 with a String of exe, which contains the path value. A screenshot will be attached that provides a visual example for your reference.

image

Event Viewer:

.Net Runtime

Application: WarBender.UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at WarBender.UI.MainForm.get_WarbandPath()
   at WarBender.UI.MainForm..ctor()
   at WarBender.UI.Program.Main()

Application Error

Faulting application name: WarBender.UI.exe, version: 1.0.1.0, time stamp: 0x5b31f0e3
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x025caf4b
Faulting process id: 0x1a8c
Faulting application start time: 0x01d4269a54f2e7ca
Faulting application path: E:\Mount_and_Blade\_tools\WarBender\WarBender.UI.exe
Faulting module path: unknown
Report Id: ac7d18a8-e0a0-4bfe-a9fc-42269acd9aec
Faulting package full name: 
Faulting package-relative application ID:
int19h commented 6 years ago

Thanks for reporting it, and my apologies for not responding earlier - I forgot to enable notifications for the tracker! :/

I'll need to look into how reliable the path detecting for GoG Galaxy is to see if that can be added. If you have more than one machine with WarBand installed via GoGG, can you check if the key is the same on all of them?

But it's definitely a bug in that it should not just fail because the registry key is missing. Looking at the code, the intended effect was to just return null, but I forgot to put some ?. where nulls appear in this case. I'll fix that, and harden the code for I/O errors and such.