Jump to content
LaunchBox Community Forums

add prestart app when starting game


d8thstar

Recommended Posts

8 hours ago, d8thstar said:

This is probably really easy to do but i can't seem to find it...

 

when starting specific games, i want to be able to send a command to run an application before the rom starts.

thanks

Right click a game, go to edit and then additional apps. You can add other programs here to run before or after the game.

Link to comment
Share on other sites

ok, i have a pre command running just fine.  how do i run a command AFTER the game quits?

i tried adding another app but the "wait for exit" option is greyed out.  the only way to select it is is to select one o-f the options above it, both of which run right before or right after the app starts.  no way to run a command at exit?

thanks!

Link to comment
Share on other sites

8 hours ago, d8thstar said:

how do i run a command AFTER the game quits?

"Automatically Run After Main Application"   A.K.A. 'run after the game exits.'

The "Wait for Exit" (only available with "...Run Before...") waits for your Additional App to exit Before starting the Main Application.  This is useful if say you have a batch file that moves/renames configuration files for the specific game.  You want that to completely finish before launching the game.

The issue that can arise with "Run After" is if your Main Application 'spawns' another program that is the actual game.  A simple example would be: your main app is a batch file ["runMyGame.bat"].  And in the batch file is something like

@echo off
G:
cd "G:\myGames\coolGames"
start "" "BestGameEver.exe" 

When you launch the game in LaunchBox, "runMyGame.bat", it then starts "BestGameEver.exe" and closes/exits/quits the batch file, while BestGameEver is still running.  LaunchBox sees "runMyGame.bat", the 'Main Application',  has Quit, so executes the "Run After".

Link to comment
Share on other sites

ah ok.  i had tried that option but both of my command lines were running, one after the other.  But what you said makes sense, i'm running teknoparrot which in turn runs the rom game exe file.

but then, teknoparrot doesn't quit when the game starts, it's still running in the background so that second command line shouldn't run until tekno closes?

Link to comment
Share on other sites

7 minutes ago, d8thstar said:

ah ok.  i had tried that option but both of my command lines were running, one after the other.  But what you said makes sense, i'm running teknoparrot which in turn runs the rom game exe file.

but then, teknoparrot doesn't quit when the game starts, it's still running in the background so that second command line shouldn't run until tekno closes?

Teknoparrot is the only system I still use RocketLauncher for since the Teknoparrot module has active monitoring for windows which is very helpful for clean startup screens and starting and stopping secondary applications.

You can manually do similar things using AHK with LB, but not worth reinventing the wheel for just those games.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
11 hours ago, d8thstar said:

is it possible to launch a pre app by emulator instead of by game?

i have an emu that i always want to start the same app before the emu starts.  i see where to do it by game, would like to do it by emu.

thanks!

You might be able to start that 'pre app' in the Running AutoHotkey Script tab for the emulator.  I mean, you can.  But I'm not sure if it'll kick off "before" the emulator starts.  Or if they'll launch simultaneously.  So if the pre app has to be fully running before the emulator starts, I guess you have a 50/50 chance with this. :D  But again, I'm not sure exactly the order they load.  If the pre app loads fast, you should be good.

Link to comment
Share on other sites

ok, got that working. but now i cant get joytokey to close at app exit.  i have this bat file that works when attached to a rom file.  but when i try the code at exit for the emu, it doesn't kill joytokey, odd!

 

run taskkill /F /im JoyToKey.exe

 

 

Link to comment
Share on other sites

Add an Escape hotkey to the Running AutoHotkey Script and have it close the emulator and joytokey.

;==================================
;       Running AutoHotkey Script
;==================================
run, joytokey.exe

$esc::
{
   WinClose, ahk_exe joytokey.exe
   WinClose, ahk_exe myEmulator.exe
}

 

Link to comment
Share on other sites

You can try getting medieval on joytokey and instead of WinClose, use:

Process, Close, joytotkey.exe

It's not a desirable way to do it as it uses a 'brute force' approach to KILL the application.  Kind of like pressing and holding the power button on your PC to shut down Windows.

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...