akorb / SteamShutdown

Automatic shutdown after Steam download(s) has finished.
MIT License
362 stars 28 forks source link

Crash On Startup #34

Closed ChadNaps closed 3 years ago

ChadNaps commented 3 years ago

2021-06-13 10:36:17 PM: System.TypeInitializationException: The type initializer for 'SteamShutdown.Steam' threw an exception. ---> System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) at System.IO.Path.Combine(String path1, String path2) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at SteamShutdown.Steam.GetLibraryPaths(String installationPath) at SteamShutdown.Steam..cctor() --- End of inner exception stack trace --- at SteamShutdown.Steam.add_AppInfoChanged(AppInfoChangedEventHandler value) at SteamShutdown.CustomApplicationContext..ctor() at SteamShutdown.SteamShutdown.Main()

Neuroquila-n8fall commented 3 years ago

I think this is a problem related to how the json is parsed. To be exact it appears as if it isn't parsed at all in this version. The path isn't extracted but instead the whole json block is. Line 213 in Steam.cs, path.ToString() yields "{\r\n \"path\": \"E:\\\\SteamLibrary\",\r\n \"label\": \"\",\r\n \"mounted\": \"1\",\r\n \"contentid\": \"291330330544794389\"\r\n}" But should be (i guess) E:\SteamLibrary

//Edit: Fun Fact: While trying to figure out what's wrong my need for this tool has vanished as my download has finished :) I'll be looking into this nonetheless as the Author seems to be busy otherwise....

akorb commented 3 years ago

Your help would be greatly appreciated. I'm very sorry that I hardly react the last time, as I'm busy with my studies at the moment.

This error seems to get quite common. I recently received a similar report. Feel free to open a pull request when you found a solution :)

Dave Ginsbach @.***> schrieb am Di., 15. Juni 2021, 23:42:

I think this is a problem related to how the json is parsed. To be exact it appears as if it isn't parsed at all in this version. The path isn't extracted but instead the whole json block is. Line 213 in Steam.cs yields "{\r\n \"path\": \"E:\\SteamLibrary\",\r\n \"label\": \"\",\r\n \"mounted\": \"1\",\r\n \"contentid\": \"291330330544794389\"\r\n}" But should be (i guess) E:\SteamLibrary

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/akorb/SteamShutdown/issues/34#issuecomment-861852908, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTBIYIDMMBYAIEIK6CDCELTS7CMLANCNFSM46UOPQ6Q .

Neuroquila-n8fall commented 3 years ago

Your help would be greatly appreciated. I'm very sorry that I hardly react the last time, as I'm busy with my studies at the moment. This error seems to get quite common. I recently received a similar report. Feel free to open a pull request when you found a solution :) Dave Ginsbach @.***> schrieb am Di., 15. Juni 2021, 23:42: I think this is a problem related to how the json is parsed. To be exact it appears as if it isn't parsed at all in this version. The path isn't extracted but instead the whole json block is. Line 213 in Steam.cs yields "{\r\n \"path\": \"E:\\SteamLibrary\",\r\n \"label\": \"\",\r\n \"mounted\": \"1\",\r\n \"contentid\": \"291330330544794389\"\r\n}" But should be (i guess) E:\SteamLibrary — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTBIYIDMMBYAIEIK6CDCELTS7CMLANCNFSM46UOPQ6Q .

Yeah I'll do that as soon as I can come up with a robust solution to this problem. Might take a few days but it's doable.

akorb commented 3 years ago

@ChadNaps Can you please verify that this version works now?

SteamShutdown.zip

ChadNaps commented 3 years ago

Checked it out and it works great! I appreciate the work you've done on this dude. Keep it up!