Jump to content
LaunchBox Community Forums

how to run exe along with game launch?


imagamejunky

Recommended Posts

Hi guys.

I posted this question on the rocketlauncher forums as well.  I'm wondering if this is possible through LB.

I'm trying to automate disabling my second monitor when a game is started and then enabling that monitor again when the game ends. After some research and tinkering, I was able to make shortcuts for displayswitch.exe /internal and displayswitch.exe /extend.  These shortcuts are working perfectly when I click them.  Now I just need help with automating this.  I want to run the internal shortcut when a game is loaded and then run the extend shortcut when the game is closed. I see the options for command line parameters when I edit a game in LB but I can't figure out how to run these exe's both at the beginning and at the end of loading a game.  I know with my PinballX frontend on my virtual pincab there is a simple way to enable a bat file or an exe both prior to and after a pinball table is loaded.  I'm assuming this is fairly simple to do in LB also but I'm a little lost.

I am using Rocketlauncher as my "middle end" for all games/emulators.

I'm trying to do this because my arcade cabinet has a second monitor for a marquee and this is hindering my ability to calibrate my aimtrak lightguns accurately on the primary monitor. When I disable the second monitor then the guns are accurate.

If one of you could help me automate this I would really appreciate it.
Thank you
Junky

Edited by imagamejunky
Link to comment
Share on other sites

It totally works!!

Thank you very much.  I saw that additional apps tab and thought it only applied to right clicking a game in LB.  I didn't realize that you could assign apps to run at the beginning and end of a game in BB.

Awesome!  Thank you again.

Is there a way to copy the additional apps assigned to one game and then paste them to a list of games?  Like a batch edit?

Link to comment
Share on other sites

Not that I am aware of.

It's not really something I use any more since we got Saturn emulation using Mednafen and Retroarch. I used to use the Additional Apps with SSF to mount and unmount disks when I first started using LB but that was a long time ago. Myself, @Zombeaver and others have asked for bulk editing or settings for the whole platform with Additional Apps but it appears to be one of those things that while on the list of things to do for @Jason Carr it's not very high on the priority.

Link to comment
Share on other sites

Yeah, bulk-editing additional apps would be super handy for certain situations. Before "Launch with..." was a thing in LB, I went through and added ePSXe as an additional app to all my PSX games (as RA Mednafen was the primary). And as Monkus said, things like SSF benefited from additional app chains as well. For a while I used them for lightgun games to start NoMousy before the game and ending it after. Eventually I changed it to just using an alternate emulator entry for Lightgun games that included this behavior in an AHK script, as that was faster than adding additional apps for all of them, but if the time requirement was equal between them, I'd prefer to do it via additional apps (as that'd mean one less "emulator" clogging up my already large list).

I know this type of thing isn't a very "sexy" addition, but this is the kind of functionality boost that's more appealing to me than most other potential improvements honestly. And the thing is, more people would benefit from it than probably realize they'd benefit from it - a lot of people probably don't know they need it until something like this comes up and then there's the moment of "Wait, I can't do that?"

Link to comment
Share on other sites

  • 4 years later...

Old topic, but I'm looking for some help with this feature - trying to pass an updated control set to my Ultimarc iPAC before a game loads - this actually switches the input from Keyboard to Gamepad and the game I'm launching seems to run the controller check at boot so it's not noticing the change

I've set the wait til exit option, but this either isn't doing anything or (more likely) it isn't enough for Windows to detect the change 

Is there any way to set a fixed delay?

Thanks

Link to comment
Share on other sites

6 hours ago, vaderag said:

I've set the wait til exit option, but this either isn't doing anything or (more likely) it isn't enough for Windows to detect the change 

Is there any way to set a fixed delay?

As you've mentioned, the problem is Windows and the time to take see the hardware changes. This is why I stopped using that feature with my iPac.

Instead of calling WinIPac directly in your pre-launch application, you could instead create a simple AHK script which then calls the WinIPac app with your profile. Then you could add a delay in the script. The problem is the time it takes Windows to see the change isn't a constant and at times I found it was too long for my liking. You'd just have to adjust the delay time and see if you have enough time to always wait out Windows and if you are happy with it.

Link to comment
Share on other sites

12 hours ago, Headrush69 said:

As you've mentioned, the problem is Windows and the time to take see the hardware changes. This is why I stopped using that feature with my iPac.

Instead of calling WinIPac directly in your pre-launch application, you could instead create a simple AHK script which then calls the WinIPac app with your profile. Then you could add a delay in the script. The problem is the time it takes Windows to see the change isn't a constant and at times I found it was too long for my liking. You'd just have to adjust the delay time and see if you have enough time to always wait out Windows and if you are happy with it.

Yeah it's problematic but this particular game (and a couple of others) really have no choice! (Well, at least that I can see)

I've also had an issue when trying to revert the ipac which caused it to get stuck in a null state and only pulling the power entirely sorted it out... 😕

 

 

Link to comment
Share on other sites

2 minutes ago, vaderag said:

I've also had an issue when trying to revert the ipac which caused it to get stuck in a null state and only pulling the power entirely sorted it out... 😕

I ran into some issues with that as well and a few times it required a reflash of the firmware.

Have you checked out x360ce? I tried it in the past and it worked well making the iPac appear as an XInput controller. (I don't use it any longer for reasons not related to it.)

Link to comment
Share on other sites

5 hours ago, Headrush69 said:

I ran into some issues with that as well and a few times it required a reflash of the firmware.

Have you checked out x360ce? I tried it in the past and it worked well making the iPac appear as an XInput controller. (I don't use it any longer for reasons not related to it.)

So I have (actually tried that first) but odd issue with it that it totally disabled my standard keyboard and mouse which made actually using it impossible!!

Steam games are the biggest problem, so many seem to allow max one player on keyboard (if any)

Link to comment
Share on other sites

2 hours ago, vaderag said:

So I have (actually tried that first) but odd issue with it that it totally disabled my standard keyboard and mouse which made actually using it impossible!!

I don't know your full set up and also only know the basics of Steam controller support, but can't you use x360ce to setup 1 (or 2 if needed) virtual Xinput devices and then use Steam's controller overlay support (not sure the correct name) to map steam controller support to those virtual devices?

Sorry I can't remember more from the methods I tried, I currently have real wireless Xbox 360 controllers on my cabinets for games that cabinet controls don't work as well.

Link to comment
Share on other sites

3 hours ago, vaderag said:

Hmm I've not heard of this (I've only just got steam up and running on my cab and haven't used it in years!!) 

Will have a google

I googled it to try to remind myself and the Steam Controller features is for mapping gamepad inputs to keyboard equivalents for game that don't support gamepads.

You said you needed keyboard support (I'm guessing that for a specific game), so you could use that with the x360ce and probably get things working, or even leave your iPac in Xinput mode if that works for your situation and doesn't have trouble with other games/emulators you use. It's really hard to say without knowing your exact set up. and which features you need the majority of the time and what work arounds you require.

Hopefully those things can get you headed to a working solution.

Link to comment
Share on other sites

6 hours ago, Headrush69 said:

I googled it to try to remind myself and the Steam Controller features is for mapping gamepad inputs to keyboard equivalents for game that don't support gamepads.

You said you needed keyboard support (I'm guessing that for a specific game), so you could use that with the x360ce and probably get things working, or even leave your iPac in Xinput mode if that works for your situation and doesn't have trouble with other games/emulators you use. It's really hard to say without knowing your exact set up. and which features you need the majority of the time and what work arounds you require.

Hopefully those things can get you headed to a working solution.

Actually the keyboard is only used for setting things up. My control panel doesnt have everything mapped so tricky to do things. And x360ce for some reason kills my keyboard (and mouse) making it impossible to set things up

I use LEDBlinky so Xinput isn't an option and 99% of the time the cab is used for Mame and I have that all set up with keyboard mode

I'm going to continue to look for other options, simply because like you I'm not trusting of the mode switch on the board

Link to comment
Share on other sites

Can you list the games that require Xinput? 

5 hours ago, vaderag said:

Actually the keyboard is only used for setting things up. My control panel doesnt have everything mapped so tricky to do things. And x360ce for some reason kills my keyboard (and mouse) making it impossible to set things up

Have you used all the shift keys of the iPac? I found with careful planning and a few changes in some emulators I've been able to eliminate a keyboard even with computer games that require some keyboard input.

Link to comment
Share on other sites

3 hours ago, Headrush69 said:

Can you list the games that require Xinput? 

Have you used all the shift keys of the iPac? I found with careful planning and a few changes in some emulators I've been able to eliminate a keyboard even with computer games that require some keyboard input.

Well Dinput or Xinput (I'll be using Dinput for LEDblinky) but the two I have at this stage are Injustice Gods Among Us (it does work with keyboard but is a nightmare as it has some hard coded buttons - there are a few threads about it) and Castle Crashers (will only allow one keyboard)

There are a couple of others but lower priority

I am using shift, but not extensively

 

Link to comment
Share on other sites

On 11/27/2022 at 1:06 PM, Headrush69 said:

Can you list the games that require Xinput? 

Have you used all the shift keys of the iPac? I found with careful planning and a few changes in some emulators I've been able to eliminate a keyboard even with computer games that require some keyboard input.

Well, I got it sorted for Injustice.

Rather than remap to Dinput / Xinput I've remapped the keyboard entirely based on image I found over on Arcadecontrols Froum

image.thumb.png.25ee55cd9903afa2a69182a85f979bbe.png

 

Doing this means that it does it quick enough to not be an issue (or at least seamlessly due to not actually changing the input type)

Still going to investigate other ways for the other games tho!

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