AstreusCoding / lol-account-manager

account manager
MIT License
19 stars 4 forks source link

Tool won't run if LoL is not installed in the default location #1

Open ignacioambrois opened 2 years ago

ignacioambrois commented 2 years ago
def login(self):
        subprocess.call(["C:\Riot Games\League of Legends\LeagueClient.exe"])
        time.sleep(2.5)
        keyboard.type(self.username)
        keyboard.press(Key.tab)
        keyboard.release(Key.tab)
        time.sleep(0.25)
        keyboard.type(self.password)

This code hardcodes the League Client's location, as such, installation with non-default locations will fail to work with the tool.

Frontear commented 2 years ago

Two suggestions:

1) We ask the user if their installation directory is non-standard to update it (run an if check to find whether the riot games directory, and subsequently league directory is in the expected directory, and if not, ask them for the correct path).

2) We find the League of Legends shortcut (hint: shell:AppsFolder), find the League of Legends shortcut and extract target path data using PyLnk 3.

I imagine the first would be easier, with the second being a nice touch of QOL.

AstreusCoding commented 2 years ago

The first suggestion is what is planned, Do some magic to try and locate the directory and if we can't find it, then we prompt the user for it.

marniwild commented 6 months ago

Can't see the login code anymore? can you send me it or comment it here thanks