itchio / itch

🎮 The best way to play your itch.io games
https://itch.io/app
MIT License
2.36k stars 210 forks source link

Auto export games to Steam Library #2268

Open BrianLima opened 5 years ago

BrianLima commented 5 years ago

There is a .vdf file that can be edited to add games to the Steam library automagically, and when Steam restarts it reads this file and then shows these games on it's library, i would love to have an option to automatically add every game i download trhu itch to my library, i feel it is most needed for VR games because i download a lot of games at once and forget to add each one to my library so i can launch from SteamVR.

aaronfranke commented 5 years ago

Can you provide documentation on this VDF file? Where is it located and how to best modify it?

BrianLima commented 5 years ago

Sure, this is their official documentation: https://developer.valvesoftware.com/wiki/KeyValues, there's also a few JS libraries for working with VDF files, i think they can be used with typescript.

The file you need to modify in order to add games to steam is

{steam userdata}\config\shortcuts.vdf

It holds all the data of custom game shortcuts, when you add a "non-steam game", Steam creates a entry in this file, each entry consists of the following data: { AppName = app.Name, Exe = "" //Path to exe StartDir = "" // Path to exe dir, AllowDesktopConfig = 1 // wether to allow Steam to configure controller bindings(?) Icon = app.Icon , Index = shortcuts.Length // Position in the VDF file, IsHidden = 0, OpenVR = 0 // include in VR library, ShortcutPath = "", Tags = new string[0] // Array of tags };

Taken from https://github.com/BrianLima/SharpSteam/blob/master/VDFParser/VDFParser/Models/VDFEntry.cs

I tried implementing this, but i never worked with typescript before.