r0fld4nc3 / Stellaris-Exe-Checksum-Patcher

Patch the game's executable so that Ironman mode can be played with Mods henceforth enabling the pursuit of Achievements with Mods.
GNU Lesser General Public License v2.1
86 stars 3 forks source link

Patcher sometimes stuck in finding Steam Library #14

Open r0fld4nc3 opened 6 months ago

r0fld4nc3 commented 6 months ago

Patcher sometimes gets stuck in trying to find the Steam Library. Unsure what is causing it. Need more reports.

Please provide me with a screenshot of the text in the programme as well as your log file.

It can be located in: %localappdata%\r0fld4nc3\Apps\Stellaris\ChecksumPatcher and is called StellarisChecksumPatcherLog.txt

If you prefer just erase/write over any more personal information such as usernames and such, but I would need to see what it's trying to do.

FitzTack commented 6 months ago

The log file seemed pretty sparse, so hopefully it helps. If there's anything else I can do to capture more data, please let me know.

StellarisChecksumPatcherLog.txt

Screenshot

r0fld4nc3 commented 6 months ago

Hi @FitzTack

Thanks for the update!

Hm indeed. In my hubris to not retain as much user info as possible it seems I've removed most useful calls and put them likely on a debug. I'll get a new version out asap and we can go from there! :)

In the meantime, a possible fix would be to do the following.

  1. Open %localappdata/r0fld4nc3/Apps/Stellaris/ChecksumPatcher
  2. Open the stellaris-checksum-patcher-settings.json file
  3. Paste the path to your stellaris.exe after the semi-colon, between the quotation marks, in the install-dir entry

It is important to place the path to the .exe within the double quotes, and don't forget the comma after the closing quotation ark It would look like the following: "install-dir": "O:\SteamLibrary\steamapps\common\Stellaris\stellaris.exe",

This should, for now, fix it, as once it's saved, it will use that stored path instead of trying to find it.

FitzTack commented 6 months ago

It seems like my copy of C:\Users------\AppData\Local\r0fld4nc3\Apps\Stellaris\ChecksumPatcher\stellaris-checksum-patcher-settings.json only contains the following:

{ "app-version": "[]" }

I deleted this and tried again, each time with 1.1.0-pre recreating the same settings file. I rolled back 1.0.6, and it contains the following:

{ "app-version": "1.0.6", "install-location": "" }

When I fill the variable with my install location, including the comma after the closing quotation like you instructed, it looks like this:

{ "app-version": "1.0.6", "install-location": "D:\Steam Library\steamapps\common\Stellaris\stellaris.exe", }

When I try to run the executable now, either 1.0.6 or 1.1.0-pre, I get the following Java crash output: Traceback (most recent call last): File "main.py", line 5, in <module> File "UI\stellaris_checksum_patcher_gui.py", line 83, in __init__ File "UI\stellaris_checksum_patcher_gui.py", line 238, in load_configs File "settings\settings.py", line 35, in get_install_location File "settings\settings.py", line 106, in load_config File "settings\settings.py", line 78, in clean_save_file File "json\__init__.py", line 293, in load File "json\__init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 353, in raw_decode json.decoder.JSONDecodeError: Invalid \escape: line 3 column 26 (char 53)

The character position referenced is the first backslash following my drive letter designation within "install-location". I have attached the log generated by the patcher during this attempt: StellarisChecksumPatcherLog.txt

EDIT: Strangely enough, even though I had deleted the application and its files and allowed them to regenerate multiple times, this time it worked. I had to escape all of the backslashes, but it ran without a hitch. I hope this intermittent behavior isn't the result of my installation environment, but hopefully some good comes from this data.

r0fld4nc3 commented 6 months ago

EDIT: Strangely enough, even though I had deleted the application and its files and allowed them to regenerate multiple times, this time it worked. I had to escape all of the backslashes, but it ran without a hitch. I hope this intermittent behavior isn't the result of my installation environment, but hopefully some good comes from this data.

Ahhh the backslash escape sequence, that's the one that broke it. I have to look as well why it is saving it like that.

And yes that was the best course to let it auto generate, so at least there's a starting base for it. I was going to suggest you try escaping the backslashes but you got there first! Good work!

I'll look at improving that as well, and not, the whole weirdness of the behaviour isn't something on your end, it isn't the first time someone has gotten stuck in the process of finding the steam library, which I find odd because I cannot replicate at all.

Thanks for the effort and hopefully it is working now (semi)!

twothirtyfive commented 6 months ago

Just to be clear to anyone reading this who may not know, escaping backslashes is done by adding an additional backslash in front of every backslash.

So it would look like this: "install-dir": "O:\\SteamLibrary\\steamapps\\common\\Stellaris\\stellaris.exe",

Aqu4tic2 commented 6 months ago

Heyo,

Had this same issue, managed to get it to work eventually. Was trying to run it from Downloads folder but it just wouldn't work. Ended up deleting the log and settings.json files.

I moved the patcher to the Stellaris install folder and ran it to generate the settings.json file, then opened the settings.json and added the "install-dir" and "save-games-dir" paths manually with escaping backslashes as explained above (thanks btw, I had no idea). Then I opened the exe and hit patch executable and it worked.

Hope this helps.

r0fld4nc3 commented 6 months ago

Hey @Aqu4tic2,

Thanks for the update!

I believe it could've been Windows being Windows not letting it run from the Downloads folder as I can run mine from there without issue, or the Desktop for that matter.

Ideally you place it somewhere easily accessible so you don't have to manually go to the game folder every time. I hope once I fix it, it won't be so clunky! But I am glad it also now worked for you!

madagent commented 5 months ago

I'm still having issues getting this to work. It just hangs.

[2024-06-06 10:47:21] [INFO]: Checking for Stellaris Checksum Patcher update... [2024-06-06 10:47:22] [INFO]: No updates found. [2024-06-06 10:47:24] [INFO]: Patching from game installation. [2024-06-06 10:47:24] [INFO]: Locating game install... [2024-06-06 10:47:24] [INFO]: Acquiring Stellaris installation... [2024-06-06 10:47:24] [INFO]: Getting installation details for game: Stellaris [2024-06-06 10:47:24] [INFO]: Acquiring Steam installation... [2024-06-06 10:47:24] [INFO]: Getting available Steam Libraries...

I edited my JSON file to look like:

{ "app-version": "1.1.0.pre", "install-dir": "G:\SteamLibrary\steamapps\common\Stellaris\stellaris.exe", "save-games-dir": "", "patched-block": "", "exe-name": "" }

I have the patcher .exe in the Stellaris folder. Tried running it from there and from my downloads folder. Same deal where it hangs. Also tried it without editing the JSON file and it did the same thing.

twothirtyfive commented 5 months ago

Can you share the contents of your StellarisChecksumPatcherLog.txt file?

madagent commented 5 months ago

Not much to go on...

[2024-06-06 10:47:21] [INFO]: Debug: False [2024-06-06 10:47:21] [INFO]: App Version: [1, 1, 0, 'pre'] [2024-06-06 10:47:21] [INFO]: Target System: Windows [2024-06-06 10:47:21] [INFO]: Program Data Path: C:\Users\jeffr\AppData\Local [2024-06-06 10:47:21] [INFO]: Config Folder: C:\Users\jeffr\AppData\Local\r0fld4nc3\Apps\Stellaris\ChecksumPatcher [2024-06-06 10:47:21] [INFO]: Checking for Stellaris Checksum Patcher update... [2024-06-06 10:47:22] [INFO]: No updates found. [2024-06-06 10:47:24] [INFO]: Patching from game installation. [2024-06-06 10:47:24] [INFO]: Locating game install... [2024-06-06 10:47:24] [INFO]: Acquiring Stellaris installation... [2024-06-06 10:47:24] [INFO]: Getting installation details for game: Stellaris [2024-06-06 10:47:24] [INFO]: Acquiring Steam installation... [2024-06-06 10:47:24] [INFO]: Getting available Steam Libraries...

[2024-06-06 10:49:36] [INFO]: Quitting Application.

r0fld4nc3 commented 5 months ago

Heya @madagent sorry for the troubles. Could you try 2 things here:

  1. Remove the executable name from the "install-dir" entry

    { "app-version": "1.1.0.pre", "install-dir": "G:\SteamLibrary\steamapps\common\Stellaris\stellaris.exe", "save-games-dir": "", "patched-block": "", "exe-name": "" }

Above is how you have it, simply remove the stellaris.exe from there so it looks like

{
"app-version": "1.1.0.pre",
"install-dir": "G:\SteamLibrary\steamapps\common\Stellaris",
"save-games-dir": "",
"patched-block": "",
"exe-name": ""
}

If it still doesn't work properly, write the stellaris.exe into the "exe-name" entry between the quotes. Just the file name.

In the end it ought to look something like

{
    "app-version": "1.1.0.pre",
    "install-dir": "G:/SteamLibrary/steamapps/common/Stellaris",
    "save-games-dir": "",
    "patched-block": "",
    "exe-name": "stellaris.exe"
}

You may copy paste it into your own json file. I replaced the back slashes with forward slashes. If the regular back slashes don't work, could also try double back slashes, but going forward I am saving them as forward slashes so it should also recognise the path just as much.

If it still doesn't work

  1. Could you try just deleting the config file (json), letting the app regenerate it and then doing the above steps? I'm positive with doing the steps described above it should work.

I really want to make this process better so this issue doesn't occur as frequently but haven't yet been able to tackle the way it finds the installation path and steam path so apologies for taking longer on that front. I'm working on reworking/refactoring it, it's a priority.

madagent commented 5 months ago

That made it work. I had to remove the stellaris.exe to get it to work. My JSON file looked like below for anyone else needing help:

{ "app-version": "1.1.0.pre", "install-dir": "G:\SteamLibrary\steamapps\common\Stellaris", "save-games-dir": "", "patched-block": "", "exe-name": "" }

I went to look at the JSON after the patcher worked and the file was updated and looked like:

{ "app-version": "1.1.0.pre", "install-dir": "G:\SteamLibrary\steamapps\common\Stellaris\stellaris.exe", "save-games-dir": "", "patched-block": "488B12488D0D1B0FB201E8BE0895018BF833C0", "exe-name": "stellaris.exe" }

r0fld4nc3 commented 5 months ago

Perfect! You really just needed to remove the stellaris.exe from the install-dir path, and possibly add stellaris.exe to exe-name and that should really be it 😄

Thank you for updating us on the matter!

Suwumonster commented 5 months ago

Anyway, I got the same problem, but I fix it with escaping backslashes. This is my json code:

{ "app-version": "1.1.0.pre", "install-dir": "D:\steam\steamapps\common\Stellaris\stellaris.exe", "save-games-dir": "", "patched-block": "488B12488D0DB31FC401E85E63A6018BF833C0", "exe-name": "stellaris.exe" }

amemiyareiji commented 5 months ago

我是这样做的 This is how I did it

github的留言框里需要按照正则表达式的方式打出4个【\】才能显示为【\\】 In the message box of GitHub, you need to type 4 【\】 according to the regular expression method to display 【\\】

C:\Users\【user name】\AppData\Local\r0fld4nc3\Apps\Stellaris\ChecksumPatcher\stellaris-checksum-patcher-settings.json

{ "app-version": "1.1.0.pre", "install-dir": "D:\\Steam\\steamapps\\common\\Stellaris", "save-games-dir": "", "patched-block": "", "exe-name": "" }

Syliss85 commented 4 months ago

i am unable to get it to work even with the above fixes and the json log file isnt any help as the others previously have posted mine looks pretty much the same

[2024-07-30 22:30:21] [INFO]: Debug: False [2024-07-30 22:30:21] [INFO]: App Version: [1, 1, 0, 'pre'] [2024-07-30 22:30:21] [INFO]: Target System: Windows [2024-07-30 22:30:21] [INFO]: Program Data Path: C:\Users\jeffe\AppData\Local [2024-07-30 22:30:21] [INFO]: Config Folder: C:\Users\jeffe\AppData\Local\r0fld4nc3\Apps\Stellaris\ChecksumPatcher [2024-07-30 22:30:21] [INFO]: Checking for Stellaris Checksum Patcher update... [2024-07-30 22:30:21] [INFO]: No updates found. [2024-07-30 22:30:23] [INFO]: Patching from game installation. [2024-07-30 22:30:23] [INFO]: Locating game install... [2024-07-30 22:30:23] [INFO]: Acquiring Stellaris installation... [2024-07-30 22:30:23] [INFO]: Getting installation details for game: Stellaris [2024-07-30 22:30:23] [INFO]: Acquiring Steam installation... [2024-07-30 22:30:23] [INFO]: Getting available Steam Libraries...

it just hangs here indefinitely.

Barragek0 commented 3 months ago

{ "app-version": "1.1.0.pre", "install-dir": "G:\SteamLibrary\steamapps\common\Stellaris\stellaris.exe", "save-games-dir": "", "patched-block": "488B12488D0DB31FC401E85E63A6018BF833C0", "exe-name": "stellaris.exe" }

was having the same issue and changing the settings file as described above worked for me.

(I did use double backslashes, they just don't appear above)

senshi-x commented 2 months ago

Had the same/similar issue with the process getting stuck on steamlibraries, of which I have multiple, and Stellaris is not on the main library either.

My stellaris-checksum-patcher-settings.json only contained the app-version key and value and no other keys. I manually added the install-dir key and pointed it to the directory with double backslashes (not the exe). I did not have to add any other keys: Starting the patcher and letting it patch now worked instantly (version 1.1.0pre).

Thanks everyone for the productive conversation that led to this workaround! <3

r0fld4nc3 commented 2 months ago

Hey @senshi-x glad to hear it worked! I've finally been able to have a Linux version working so now I can have it on Windows & Linux. Next focus will be to add some more robust support to it as well as finally digging in on the Steam Library issues, because I can't remember at the moment now if I've tweaked it to a point where it works better!

Thanks for the update and for using it!