tanjera / infirmary-integrated

Medical device simulator for training healthcare professionals.
http://www.infirmary-integrated.com/
Other
40 stars 5 forks source link

Loading file from .exe arguments not working? #166

Closed tanjera closed 1 year ago

tanjera commented 1 year ago

File associations set in OS, double-click .ii sim file, IISIM opens but did not load the file. App.exe args not working?

tanjera commented 1 year ago

Tested on Windows 10: works fine when filename is arg[0] (hardcoded test in Program.cs Main(string [] args) ... Can look into whether Nullsoft packaging sets the "Open With" args properly?

tanjera commented 1 year ago

Tested a custom "Release"-compilation that prints all startup args[] to a text file. Was compiled and packed w/ NSIS (through the usual compilation/packaging pipeline scripts), installed to Windows 10. When an .ii file was double-clicked, proper args were outputted to text file (no problems noted with filepath, args formatting, special characters, etc.) but II interface did not reflect having loaded any file (at default startup appearance).

Code was injected at Program.cs Main(string[] args) line 15

tanjera commented 1 year ago

Tested with Debug arguments (via Visual Studio) being passed in via "command line arguments" and worked with no problem, .ii file loaded properly.

tanjera commented 1 year ago

Tested with similar method to:

Tested a custom "Release"-compilation that prints all startup args[] to a text file.

Code added in App.axaml.cs OnFrameworkInitializationCompleted() line 96 ... same result, arguments were passed in without problems.

May need to add error logging to file output to debug issue.

tanjera commented 1 year ago

Fixed in 43dfce53fc45ddace5ce1cf343f5452ce6ee8435