Made a game launcher using python
Tags: github, showdev, python
Published: 2020-06-29 07:02:26

![](https://github.com/sakshatshinde/Plei/blob/master/plei.png?raw=true)

I made a simple game launcher using **python** 
It was not an easy task. But definitely doable.

## Why did I make it?
I am sure anyone with a decent sized game library has had this issue. You want to play a game and *also* want to keep your desktop clean, i.e. not having a huge list of shortcuts staring down at you whenever you boot up a computer.

> I did it for my sanity

I looked for existing options, but felt like they were doing a lot more than what I needed. I just wanted a list of the games installed. Nothing more nothing less. 

Then I realised it'd be a great project to work on. My initial goal was to just make sure all the major stores / launchers like

* steam
* origin
* uplay
* epic games

So I sat down and devised a basic plan on how it's gonna work.

![](https://camo.githubusercontent.com/2b7a2a3e3bcb14c99983742021f2a31cfb4587eb/68747470733a2f2f6d65726d6169642e696e6b2f696d672f65794a6a6232526c496a6f695a334a686347676754464a63626c78755154355162475670585341744c543467553374375533526c5957313966567875515341744c543467525874375255645466583163626b45674c53302d494539376530397961576470626e313958473542494330745069425665337431554778686558313958473542494330745069424365337469595852306247564f5a58523966567875515341744c543467554674505a6d5a736157356c494564686257567a58567875557941744c54346754696854644739795a53424f5a58523362334a724946427962335276593239734b567875525341744c54346754696854644739795a53424f5a58523362334a724946427962335276593239734b567875547941744c54346754696854644739795a53424f5a58523362334a724946427962335276593239734b567875565341744c54346754696854644739795a53424f5a58523362334a724946427962335276593239734b567875516941744c54346754696854644739795a53424f5a58523362334a724946427962335276593239734b567875554341744c543467596d6c754b454a70626d467965534246574555705847354f494330754c5434675443686254474631626d4e6f4948526f5a53426e5957316c58536c63626d4a70626941744c69302d494577694c434a745a584a7459576c6b496a7037496e526f5a57316c496a6f695a47566d5958567364434a396651)

I quickly realised it was way easier than I thought. These existing launchers have a *protocol* in place to launch games which I can harness in my launcher which would also make sure that this doesn't break with any future updates.

Now these *protocols* need *game IDs* to launch a specific game
Here are some examples :

```python
STEAM = "steam://rungameid/" 

EGS = "com.epicgames.launcher://apps/" # + ?action=launch&silent=true"

UPLAY = "uplay://launch/"   # launch/ID/0

ORIGIN = "origin://launchgame/"
```

Then you just pass the appropriate *game ID* to these protocols and viola it launches the game!

# How did I manage to find game IDs for every single game? 

I had to spend some time on https://gaming.stackexchange.com/

This post here explains how I implemented it for uPlay
[A simple way to find installed games' uPlay IDs with python](https://dev.to/sakshatshinde/a-simple-way-to-find-installed-game-s-uplay-ids-with-python-3jf6)

Essentially there are different ways to extract game IDs for each vendor, I wont go into the details here but if you wish to know more about how its implemented you can checkout the project linked down below.

{% github https://github.com/sakshatshinde/Plei %}

* [Direct link to the code for finding IDs](https://github.com/sakshatshinde/Plei/blob/master/src/gameOps.py)

### Hope you learned something new 💖