Jump to content
LaunchBox Community Forums

CLI Launcher - LaunchBox Command Line Interface for launching games directly from Stream Deck


Recommended Posts

CLI Launcher - LaunchBox Command Line Interface for launching games directly from Stream Deck

View File

This plugin adds a command line interface to LaunchBox/BigBox for launching games via Stream Deck or having platform and playlist shortcuts. Marquee(s)* and LEDBlinky get updated automatically. Launching games on a remote PC is also supported.

*All Marquees will be updated when using either LaunchBox or BigBox if you are using the ThirdScreen Plugin. If you're using the default BigBox marquee handling, then your single marquee will be updated when using BigBox only.

 

Installation:

  1. *** Before installing, if you are using the ThirdScreen plugin please make sure you are using the latest version. Version 3.0.1 or higher is compatible. ***
  2. Download CLI_Launcher.zip to your PC. Right click on the zip file and extract all files.
  3. Close LaunchBox/BigBox and copy the Plugins and ThirdParty folders to your LaunchBox directory. 

 

Usage:

Game Shortcuts (launch command)(works with both LaunchBox and BigBox)

Create an AHK script with the following line, and point your StreamDeck shortcut to that script:

     Run, "<path_to_launchbox>\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch "<platform_name>" "<game_name>"

 

For example, to launch Street Fighter Alpha 2 from the Arcade platform:

Run, "C:\Users\Administrator\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch "arcade" "Street Fighter Alpha 2"

 

Platform Shortcuts (platform command)(added in v2.0.0 - only works with BigBox)

Create an AHK script with the following line, and point your StreamDeck shortcut to that script:

     Run, "<path_to_launchbox>\ThirdParty\CLI_Launcher\CLI_Launcher.exe" platform "<platform_name>"

 

For example, to navigate to the Arcade platform in BigBox:

Run, "C:\Users\Administrator\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" platform "arcade"

 

Playlist Shortcuts (playlist command)(added in v2.0.0 - only works with BigBox)

Create an AHK script with the following line, and point your StreamDeck shortcut to that script:

     Run, "<path_to_launchbox>\ThirdParty\CLI_Launcher\CLI_Launcher.exe" playlist "<playlist_name>"

 

For example, to navigate to the favorites playlist in BigBox:

Run, "C:\Users\Administrator\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" playlist "favorites"

 

Remote commands:

To run a command on a different PC that has the plugin installed and is running LaunchBox or BigBox just add "remote_ip=<ip_of_remote_pc>". For example, to launch a game on a different PC with IP 192.168.168.238:

Run, "CLI_Launcher.exe" launch "arcade" "Street Fighter Alpha 2"  "remote_ip=192.168.168.238"

 

FAQs:

Q. What if neither LaunchBox nor BigBox are open when the script runs?

  A. The command will just get ignored if LaunchBox or BigBox is not open.

Q. What if a game is already open when the script runs?

  A. The command will just get ignored if a game is already open.

Q. Why not just launch the emulator and/or game directly from the script?

  A. Using CLI Launcher is much simpler and leverages all the work you've already done in setting up LaunchBox to properly launch the game. Also, if you were to run the emulator and/or game directly from the script, your Marquee(s) and LEDBlinky would not get updated for the game.

Q. If I want to use remote commands, which port do I need to ensure is open?

  A. If you are having trouble with remote commands, ensure port 0xb0b0 is open in Windows Firewall on the remote PC. 

Q. Why would anyone want to launch a game on a remote PC?

  A. Dunno... but you can now.

Q. Are AutoHotKey scripts really necessary?

  A. No, that's just the way I do it. You could also just point the Stream Deck shortcut directly to CLI_Launcher.exe and pass in the correct arguments.


 

Link to comment
Share on other sites

  • 3 weeks later...

Thanks soo much for this plugin, it works perfectly. It took me a little while to get everything set up, so I wanted to share what I've done in case it's helpful for anyone else. 

  1. First, I needed to install AutoHotkey (I'm not a regular Windows user and this was unfamiliar to me). Found at https://www.autohotkey.com/
  2. This added a shortcut to the right-click popup menu in Windows ... New-->AutoHotkey Script ...this gives a basic script with some default startup commands that I left as-is
  3. From there I could use the format indicated by adding a new line to the script using the Run command (i.e., prepend the line with "Run").
  4. .I ran LaunchBox to test. The script works when double-clicked and when launched from Stream Deck via a System-Run macro.

I was then going to create scripts for all the games I wanted to launch from Stream Deck. I noticed a couple of things:

  1. NotePad happily strips away the file type identifier if you use "Save As", making the script a plain text file, which can't be launched, so be careful with that. 
  2. When the AHK script is launched a terminal window pops up for a second. This behaviour can be changed by passing the "Hide" option to the AHK Run command (see the attached script)
  3. I didn't want to create a separate script file and separate Stream Deck macro for each game. 

Instead, I use StreamDeck to pass the name of the game as an argument to a generic AHK script (attached, you'll need to update path details to reflect your setup). I had to install the (very nice) Advanced Launcher Stream Deck plugin to do this because the default System launcher in Stream Deck doesn't like arguments.

Note 1:  all of my go-to games are for the "arcade platform", so I don't pass platform as an argument, but this could be done easily enough: AHK uses numbered variables for each argument, so %1% gets the value of the first argument, %2% gets the second, and so on.

Note 2: any game names with spaces or punctuation should be provided in double quotes to be sent to the script as a single argument

PlayGame.ahk

  • Game On 1
Link to comment
Share on other sites

@derekpacoAlt I'm glad it's working for you and thanks for sharing those details. I've updated the instructions with the missing Run command.

Also, if you are using the Stream Deck Advanced Launcher and want to remove the AHK step altogether, you could point the Stream Deck shortcut to CLI_Launcher.exe and pass in the correct arguments.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...