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.
  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 (simple game shortcuts):

  • Right click on a game in LaunchBox and choose "CLI Launcher->Create Windows Shortcut".

image.thumb.png.3396e88cf1a020547ba0a8f083e5f8cd.png

  • A dialogue will open to allow you to choose the name and location of the game shortcut. When ready, click "Save" to create the shortcut.
  • To create windows shortcuts for a batch of games at once: Select multiple games, right-click and choose "CLI Launcher->Create Windows Shortcuts".

 

Usage (advanced shortcuts and Stream Deck):

The currently supported commands are listed below. These can be run from a Stream Deck, from AHK scripts, or directly from the command line. To run a command from a Stream Deck, open the Stream Deck app and drag the Open action onto one of your buttons. Then on the App/File line, enter the commands as shown below including any required parameters. For example:

image.thumb.png.facc60933e48c115363b53275a5abf96.png

 

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

     "<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:

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

New in v7.0.0 (launch_by_id command): To launch a game using its game id instead of platform name/game title you can use the launch_by_id command. For example:

"C:\Users\Administrator\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch_by_id "1e48ac15-55e2-47f7-a33e-486451a16def"

New in v7.0.3 (launch_by_db_id command): To launch a game using its database id instead of platform name/game title you can use the launch_by_db_id command. For example:

"C:\Users\Administrator\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch_by_db_id "2532"

New in v8.0.1: The option "-t=num_minutes" can be passed to the launch commands. The game will be launched and then automatically closed after the specified number of minutes. By default it will attempt to use the ESC key to exit the game, but for games where that won't work (e.g Windows games) then you can also pass "-altf4" to tell it to use Alt-F4 to exit instead.

 

 

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

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

 

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

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

New in v8.0.1: The option "-all" can be passed to the platform command instead of a specific platform. This will take you to the platform/playlist root menu.

 

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

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

 

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

"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:

"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 get ignored if LaunchBox or BigBox is not open. As of version 8.0.0 you'll also get an error message when trying to run shortcuts without LaunchBox or BigBox being 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 Stream Deck or 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 a script, your Marquee(s) and LEDBlinky would not get updated for the game.

Q. Instead of manually entering the command for a Stream Deck button, can I use the "Create Windows Shortcut" game menu item and then just point Stream Deck to that shortcut?

  A. Yes, but... The Stream Deck app has a quirk where if you use the file selector button to select a shortcut, it will jump straight to the executable that the shortcut points to and it will ignore any parameters that the shortcut was passing in. So to get it to work with a shortcut you have to just type out the full path to the shortcut (including the .lnk extension) on the App/File line instead of using the file selector button.

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.

 

 

 


 

  • Like 1
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

  • 5 months later...

CLI is super but i notice that keep getting a brief command prompt pop up when using the function, i know theres @echo off for bat files, but is there a way this could be silent in the background somehow?

Link to comment
Share on other sites

20 minutes ago, DemmyTree said:

CLI is super but i notice that keep getting a brief command prompt pop up when using the function, i know theres @echo off for bat files, but is there a way this could be silent in the background somehow?

Try passing the Hide parameter to the Run commands like @derekpacoAlt mentioned above. I'll update the instructions to include it.

Link to comment
Share on other sites

ah i've been using command prompt for using it but it doesnt have a silent mode through that method, using something called MacroDeck as an alternative to Streamdeck, it does support AHK scripts but i'll have to try use that instead

Link to comment
Share on other sites

  • 1 month later...

Very cool plugin really great to be able to call on launchbox from outside. However I'm wondering would it be possible to launch your game by using the the location or game ID perhaps. I can understand it may not be everyone's preference but with the current way of launcing you can't launch alternative apps/versions such as megaman 2 vs. rockman 2. Also if you used an ID and or file location it wouldn't be necessary to call on a specific playlist/platform but perhaps that's exactly the reason why it's not possible now ...

Link to comment
Share on other sites

5 hours ago, banggun said:

Very cool plugin really great to be able to call on launchbox from outside. However I'm wondering would it be possible to launch your game by using the the location or game ID perhaps. I can understand it may not be everyone's preference but with the current way of launcing you can't launch alternative apps/versions such as megaman 2 vs. rockman 2. Also if you used an ID and or file location it wouldn't be necessary to call on a specific playlist/platform but perhaps that's exactly the reason why it's not possible now ...

@banggun Sure, no problem. Try version 7.0.0. I added a command to launch a game by the game id. For example:
"C:\Users\MyUserName\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch_by_id "1e48ac15-55e2-47f7-a33e-486451a16def"

  • Unusual Gem 1
Link to comment
Share on other sites

  • 4 weeks later...

Been using this with ThirdScreen and it's working phenomenal. Only issue is when used in conjunction with the Dolphin emulator (for Wii games specifically). The marquee doesn't land and stay on the wii game, instead reverting to whatever game it was hovering over before. Not a huge problem, except that my marquees are set up to play video, sound included...so the video sound plays while I'm ingame :/ Any idea on how to fix that?

 

Thank again for the plugin, btw. It's a lifesaver.

Link to comment
Share on other sites

50 minutes ago, shadowblind said:

Been using this with ThirdScreen and it's working phenomenal. Only issue is when used in conjunction with the Dolphin emulator (for Wii games specifically). The marquee doesn't land and stay on the wii game, instead reverting to whatever game it was hovering over before. Not a huge problem, except that my marquees are set up to play video, sound included...so the video sound plays while I'm ingame :/ Any idea on how to fix that?

 

Thank again for the plugin, btw. It's a lifesaver.

 

@shadowblind I just gave it a quick try and didn't see any issues launching Wii games. Could you send me the command string you are using as well as the two log files after it happens: Logs/StreamDeckGameLauncher.txt and Logs/ThirdScreenLog.txt. First make sure logging is enabled in ThirdScreen (in ThirdScreen Settings click the gear icon in the upper right and select Enable Debug Logging).

  • Like 1
Link to comment
Share on other sites

19 hours ago, superrob3000 said:

 

@shadowblind I just gave it a quick try and didn't see any issues launching Wii games. Could you send me the command string you are using as well as the two log files after it happens: Logs/StreamDeckGameLauncher.txt and Logs/ThirdScreenLog.txt. First make sure logging is enabled in ThirdScreen (in ThirdScreen Settings click the gear icon in the upper right and select Enable Debug Logging).

For sure! The two log files are attached, and here's the string I'm using:
 

Run, "C:\Users\mwbuc\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch_without_menu "Nintendo Wii" "kirby's epic yarn"

StreamDeckGameLauncher.txt ThirdScreenLog.txt

Link to comment
Share on other sites

1 hour ago, shadowblind said:

For sure! The two log files are attached, and here's the string I'm using:
 

Run, "C:\Users\mwbuc\LaunchBox\ThirdParty\CLI_Launcher\CLI_Launcher.exe" launch_without_menu "Nintendo Wii" "kirby's epic yarn"

StreamDeckGameLauncher.txt 172.6 kB · 1 download ThirdScreenLog.txt 1.21 MB · 1 download

Thanks for the logs. That allowed me to recreate it. I should have a fix soon.

  • Like 1
Link to comment
Share on other sites

3 hours ago, superrob3000 said:

@shadowblind Please grab the latest version of ThirdScreen (v5.0.9). It should fix the issue.

Thanks for the update. It displays the correct marquee video now, and for a moment as the game is booting, the video audio mutes (as it should). However after Dolphin loads the game, the marquee video's audio becomes audible again even while the game is playing. Attached the logs below in case it helps!

StreamDeckGameLauncher.txt ThirdScreenLog.txt

Link to comment
Share on other sites

14 hours ago, shadowblind said:

Thanks for the update. It displays the correct marquee video now, and for a moment as the game is booting, the video audio mutes (as it should). However after Dolphin loads the game, the marquee video's audio becomes audible again even while the game is playing. Attached the logs below in case it helps!

StreamDeckGameLauncher.txt 175.28 kB · 1 download ThirdScreenLog.txt 1.24 MB · 1 download

@shadowblind v5.0.10 should hopefully fix the audio issue. Please let me know.

  • Like 1
Link to comment
Share on other sites

23 minutes ago, superrob3000 said:

@shadowblind Awesome, glad to hear that. The link is available when you open ThirdScreen settings, but that's not necessary. I only added it because people ask sometimes.

You put in a lot of work to this app, and we appreciate it. I think it's reasonable to support that!

Edited by shadowblind
  • Thanks 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...