JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
9.54k stars 506 forks source link

Battle.net game import #34

Closed JosefNemec closed 7 years ago

JosefNemec commented 7 years ago

Full battle.net account sync is too complicated, but we could at least add support to automatically import installed games.

ziplock9000 commented 7 years ago

Another vote for this.

outlawzgosu commented 7 years ago

A current manual workaround you can do for now is:

-add a new manual game. -select the Actions tab -hit "Add Action" -set type to URL -type "battlenet://D3/" in the "Path" text box.

To add other games, do the same except replace the path with one below:

Hearthstone: battlenet://WTCG/ Diablo 3: battlenet://D3/ Starcraft 2: battlenet://SC2/ World of Warcraft: battlenet://WoW/ Heroes of the Storm: battlenet://Hero/

Your Bnet launcher has to be open for this to work, otherwise the shortcuts will just open the bnet launcher.

JosefNemec commented 7 years ago

Or you can also go via "Import Installed or from Folder...", pick Blizzard games from the list and they will import with all paths and icons set already.

judge2020 commented 7 years ago

Problem with Blizzard games is that running from the straight EXE will just open the bnet launcher instead of the game.

Also, overwatch URI: battlenet://Pro/

JosefNemec commented 7 years ago

Lots of people are requesting this, but I don't have a time to get this to 3.0 If you guys want to help then find where Battle.net stores information about what games are currently installed. That would help me a lot to get this feature done sooner and it would at least allow Playnite to import installed games if not whole library. Thanks

outlawzgosu commented 7 years ago

Are you looking for a list that has the current installed blizzard games to be in or would the registry work? Blizzard stores a few registry entries that are always created when a game is installed, and removed when the game is uninstalled.

These are the games I was able to test this on, since they're the only ones I have installed. Bnet Launcher games:

Standalone games:

I'm unable to test Warcraft 1 or warcraft 2

I don't know what you would need to do on the programming side, I guess add an "import blizzard games" button and do a check to see which of the games' registry entries exist (playnite would probably have to have a list of blizzard's games somewhere). If the entry exists then add it to the game list. Blizzard doesn't have that many games so the list can be updated after a new game comes out.

I don't know how you would launch the game though since you can't do it through the EXE. The EXE will always open the launcher, even if you already have the launcher open. It would have to be through the URL method while the blizzard launcher is open. I'm completely guessing on what you need to do to make this work though so don't take my advice that seriously.

Edit: I also just found out that to view these entries, you may have to use the regedit.exe that's located in C:\Windows\SysWOW64 and not in C:\Windows\

JosefNemec commented 7 years ago

I guess I could check it via those Uninstall keys, but I would have to hard code it for each game. I was looking for something that would give me a list of apps, preferably including those ids that go into battlenet://{id}/ url.

JosefNemec commented 7 years ago

Found it, you don't have to look anymore :)

ziplock9000 commented 7 years ago

If this suggestion only works for installed Blizzard games then it's not worth bothering about since the rest of Playtime works for uninstalled games. You'll have mismatched functionality otherwise

JosefNemec commented 7 years ago

UPlay integration also works only with installed games. I wouldn't say it's not worth it.

kevinvanrijn commented 7 years ago

FWIW Hearthstone-Deck-Tracker is able to launch Battle.net followed by Hearthstone from a single user click. Could their implementation be useful?

(Guessing they also have some way to detect if HS is installed but I haven't found it yet.)

JosefNemec commented 7 years ago

Right now I have everything I need to implement it, maybe even uninstalled games. Thanks everybody trying to help me with it, I really appreciate it.

judge2020 commented 7 years ago

@KIPdeKIP btw, HDT just assumes you have HS installed (and we use battlenet://WTCG to launch it)

JosefNemec commented 7 years ago

Released in 2.7