andsfonseca / dota2-rpc-client

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service. 🎮
https://andsfonseca.github.io/dota2-rpc-client/
MIT License
41 stars 8 forks source link

[Bug]: Service fails to install #23

Closed leamare closed 1 year ago

leamare commented 1 year ago

Are you on the latest version?

Is there a fix in progress related to your proposal?

Describe the bug

The install script fails to install a service (it doesn't show up in the services list) or add the gamestate_integration_rpc config. Output looks completely normal.

Expected Behavior

Service installs and runs

Dota 2 Patch

No response

Steps To Reproduce

It happens just while executing the install script as usual.

Anything else?

Hard to specify the exact reason. My main PC has two users setup (both have admin privileges), this might be the issue. Alternatively, I suspect there is some kind of access issue.

Might need to try a debug build with verbose output to figure out what's happening there.

leamare commented 1 year ago

Tried versions 1.0.2, 1.0.3, 1.0.4

Version 1.0.2 ended up installing the service/config, but it couldn't run. Running the executable with -f flag led to crash with "Failed to debug" error. Non-debug version just ended up crashing silently.

Versions 1.0.3 and 1.0.4 were similar. Install script was running properly, but the service wasn't installed for whatever reason. Launching them with -f flag didn't led to any crashes (unsurprisingly), but it didn't seem to connect to the game client.

It doesn't seem like a permissions problem (1.0.2 was able to install, after all), but I suspect there might be a problem with accessing the 52424 port? Not entirely sure.

andsfonseca commented 1 year ago

image

This is the output when the installation process work. Can you send a picture of the output when you try install?

leamare commented 1 year ago

image

andsfonseca commented 1 year ago

@leamare Can you run a trial version on your machine? I created a version with more debug messages. It won't be necessary to uninstall your current version, just unzip and run.

When you confirm I send the file

leamare commented 1 year ago

I'll be able to run it tomorrow.

andsfonseca commented 1 year ago

dota-rpc-client-test.zip

leamare commented 1 year ago

image

Seems to be a permission issue after all, though I'm not sure where it could've come from and what folders is it using.

andsfonseca commented 1 year ago

Just to be sure, does this error also happen when you run as administrator?

andsfonseca commented 1 year ago

I will create an exception handler in case it fails to create the folder or file.

In case of error, manual installation information should appear in the terminal

andsfonseca commented 1 year ago

dota2-rpc-client-test.zip

This version has exception handling. The output will also show which files it tries to write and an error message should be displayed if it fails.

leamare commented 1 year ago

Just to be sure, does this error also happen when you run as administrator?

Yes, I only run it from an admin PShell.

image

Seems like there is the issue. It's trying to create a folder and cfg file in F:\SteamLibrary\... But Dota client is located in D:\SteamLibrary\....

It should probably have some kind of feedback when this happens and also show the path it used. Changing "STEAM_FOLDER" in the config file doesn't really solve the issue (it's still looking in the wrong library folder).

leamare commented 1 year ago

I tried it with the mainline 1.0.4 version. Changing STEAM_FOLDER to D:\\SteamLibrary forced it to actually show this prompt:

File 'D:\SteamLibrary/SteamApps/libraryfolders.vdf 'not found!
Unable to find 'dota 2 beta' folder using steam library, please set the directory...

and allow me to manually select dota 2 beta folder.

So it seems to be the issue with the automatic folder detection

In the libraryfolders.vdf the "F" drive one comes first, but it doesn't have "570" listed. Only the "D" library folder.

andsfonseca commented 1 year ago

You're right!

Can you send me a copy of your libraryfolders.vdf file for me to take a look at. (You can remove some games from your list and your personal information if necessary)

leamare commented 1 year ago

Here's the copy

libraryfolders.vdf.txt

andsfonseca commented 1 year ago

@leamare, can you test this version?

This is the definitive version, so it is recommended to uninstall the old one if you have it installed.

Link: #24

leamare commented 1 year ago

This should do

image

andsfonseca commented 1 year ago

Perfect, I hope that's all. Thanks for testing with me.

I will accept the pull request and close the thread. You can reopen if you need.