
If (Test-Path -LiteralPath "Q:\GOG Galaxy\Games\Armikrog\Armikrog.exe") The "-LiteralPath" and quotes help it handle spaces in the paths.

This checks to see if a file you define is present (pick something that definitely means the game is installed), and if it is present, runs a command you define (can be the same as the first one), and if the file isn't present, runs the relevant launcher so you can install the game. Powershell.exe -executionpolicy remotesigned -File.

So, to run the game Armikrog, which I have on GOG, I have the following batch and script. \Scripts\ folder is the subfolder where the scripts are. Without that, you would need to confirm every time, which kind of misses the point of automation. The "remotesigned" in the middle actually tells it to still ask for signatures/permission on scripts downloaded from the internet, but not local scripts. I have one folder to hold the batch files, with a subfolder to hold the scripts, which keeps things nice and neat and easy to import if I need to do it again.Īll this does is run PowerShell.exe, tell it not to bother you by asking for a signed script at the moment, then the script to run. The added bit is the script, which checks to see if the game is installed (by looking for a file that would be present if it is), and either runs the game or the relevant launcher, as appropriate. Slightly more trouble to make than a shortcut, but it's still copy-paste easy. In place of the shortcut, there's a batch file to run a PowerShell script. Once I get the batch and script set up, I can uninstall the games until I want them. So, this does involve a bit more work, but it saves me from having to keep all my games installed in order for them to show up in LaunchBox and provides a clean link to the relevant launcher/installer if I do want to play them. If I was going to do that, surely I could figure out some way to have the ones that come with launchers in a friendlier fashion.

I came up with this after learning that the current way to import GOG/Itch/GameJolt games and any other games that don't show up in the Start menu was to create shortcuts and import those. You will need to know where files go with each game the simplest way to do this is to install them, then uninstall them once you get them into LaunchBox. TL DR: You can use a copy-paste batch file and a PowerShell script to emulate the Steam behavior that allows games to be handled well whether or not they are currently installed.
