Jump to content
LaunchBox Community Forums

Additional Apps "After" seems to run immediately


Recommended Posts

I have an IPAC on arcade sticks and am trying to load Headsoft Vjoy profiles at the start of Castle Crashers, then exit out at the end.

The start vjoy works fine, and the end vjoy works fine when I run them separately, but if I tag the "End Vjoy" application to run after, it seems to run both additional apps immediately once I run the game.

In the attached picture, I have End Vjoy not automatically running, because its the only way I could get it to work.  Ive tried running Castle Crashers both as the runsteamid string and pointing it to the executable, but it seems to do the same thing.  Its like its not pausing in between the before and after runs.  Is there any other way to try and automatically run the vjoy string?


My only other thought is to do it outside of Launchbox through Closemul or something like that, but Id really like to just do it in Launchbox as it seems like it has the capability, its just not working for me.


Any help would be appreciated.



Link to comment
Share on other sites

I removed both and readded, same behavior. 


Next ill try adding a whole new game entry for Castle Crashers, and see if that does it.


Getting the after to fire "after" is obviously what I would want eventually, but if I cant get it to stop firing before the game launches, then it doesnt really matter.  Any other thoughts on how to prevent it from going off immediately?

Link to comment
Share on other sites

Can you try running a batch file before and after instead, as a test?

Open notepad and put this in it:

     echo %time% >> c:\temp\log.txt

Make sure you create a folder named temp in your C drive so the batch file can write the time in it.

Save the notepad file in c:\temp as test.bat

Add the batch file test.bat to a before and after on the game you re trying.

Launch your game, wait a couple minutes, exit your game.

Open the file log.txt and see if it wrote two different times or the same time twice.

I just want to see if the before and after is really running both at the same time for you.

Link to comment
Share on other sites

also, i see in your screenshot that you are launching a Windows game. so i assume no emulator is set in the emulator tab.

so what is the launcher tab actually launching? Is it launching some exe program that only runs briefly to launch some other process? maybe the process that you have set only runs briefly and then exits? 

Link to comment
Share on other sites

Right, its a steam import.  Originally it was launching the steamid link, Itried changing it to the actual exe of the game, thinking along those same lines that the before/after may be tied to the item in the launcher path.  Castle.exe is whats it pointing to, and what the process is called if I check it out while its running.

I made the logging batch file, and saw cmd prompt windows pop one after another when launching the game.  Heres some more screens to help.








Link to comment
Share on other sites

Hmm, so my guess is that castle.exe runs for about 1-2 seconds, exits, and then maybe runs again. That's a problem.

This seems like Steam games could be a problem for LB additional apps feature. I've not tried additional apps with my Steam games, but I did plan to for some of them and now I'm concerned that I'm going to run into this issue :(

The bottom line here is that I "think" LB is doing what it's told. I think castle.exe runs, exits, and runs again.

You could confirm this by adding the process id column to task manager and watching closely to see if castle.exe has one id very briefly for a second or two and then changes to a different pid. That would prove it runs, exits, runs. I have to assume that this is what is going on here.

I wonder if @Jason Carr has any thoughts on this?

Link to comment
Share on other sites

Yeah, a delay may be all it needs, like dont check for exit app until at least 5s past startup or the like...

I thought the start and relaunch was the issue with it trying to run from the steam url, and had hoped pointing it directly to the castle.exe would have fixed that possibility.  But maybe it is reopening itself for some reason.  Im at work and remoting into my arcade machine, so doing watching the process ID would be tricky, I can check that out when I get home and report back.


Thanks again for the help.

Link to comment
Share on other sites

i would file a bitbucket ticket on this. seems like LB may need a way to deal with this for Steam or other games with Steam like launchers. at this point though, i guess we don't know if this a rare instance or if it will happen for all steam games. i'm gonna have to try this with my steam games when i get a chance on friday or the weekend.

Link to comment
Share on other sites

only way i can think of as a workaround to this problem for now is to add a before app which is a script (like an ahk script) and in that script you create, you would have to have it do something like sleep a few seconds, then run a LOOP that checks for existence of castle.exe and if castle exe doesn't exist then run your after program and exit the script.

if i have the same problem as you this weekend, i may write such a script.

Link to comment
Share on other sites

I dont know if you are familiar with the program Closemul.exe, but it came around like I dunno, 5 years ago as a inbetween to try and do stuff like this.  Basically from your front end you would launch closemul with arguments, and it had its own ini to launch the emulator, along with features like killing emulator processes with esc key, running additional apps, mounting virtual drives before emu launch, and demounting after, etc.  

You would basically put a copy of closemul.exe and its ini in every emulator directory to customize how its launched independent of front end.  Then the front end calls closemul and passes the rom name.


At any rate, that may work for this, cause closemul may stay open while it launches castle crashers, then LB checks for Closemul.exe instead of castle.exe....  I dunno ill try it.


It is good to know its not all steam games though.


Again thanks for the help.

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.

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