Jump to content
LaunchBox Community Forums

Launchbox, ParaJVE, AHS, and the loss of hair follicles


launcherbox

Recommended Posts

Hi folks, just wondering if anyone might be able to help me with this issue. Basically I've used Zombeaver's excellent guide to get ParaJVE set up, configured, and working in Launchbox. Lovely little emu, and for the most part, plays lovely with LB. That is, until I went to start a game...damn, no controller support in ParaJVE. So I figured I needed a mapper, so I used Xpadder, which again, works perfectly. I can now launch, play, and exit games in ParaJVE through LB. Cool. 

 

Next problem, I need Xpadder to launch before ParaJVE...no problem, LB has me covered. I use the Additional Apps feature to configure Xpadder to start before ParaJVE starts, and it works flawlessly. I now boot a game, Xpadder will launch, it'll load the profile, ParaJVE will launch, the game will boot, I play the game, and exit it. Perfect. Only problem is Xpadder remains active/running. Fine, I'll add a second instance of an Additional App configuration to stop Xpadder when ParaJVE is closed down.

 

Here's where the problems begin. For whatever reason, LB cannot 'see' what the status of ParaJVE is, because when I create a second instance of Additional Apps to close Xpadder upon exiting ParaJVE (automatically run after main application), Xpadder will close right after it's launched. No matter what way I configure the additional app settings to close Xpadder, it just either won't close, or closes while ParaJVE is still running. I can't get it to close Xpadder, when I exit ParaJVE.

 

So after some research, I found suggestions of maybe creating a autohotkey script. This one (tailored for my needs) is the one I've tried:

 

#SingleInstance, Force
#Persistent
SetTitleMatchMode, 2
DetectHiddenWindows, On
 
SetTimer, ProcessCheckTimer, 3000
Return
 
ProcessCheckTimer:
Process, Exist, javaw.exe
pid1 := ErrorLevel
If (!pid1)
         {
	 Process, Close, Xpadder.exe
         ExitApp
         }
Return

 

^^ I'm no scripter, but from what I understand, the above basically is asking that the process "javaw.exe" is checked to be running or not (this is needed for ParaJVE), and if it's not found to be running, then the process of Xpadder.exe is closed. However, it doesn't work. When I quit ParaJVE, Xpadder still will not close.

 

Has anyone any ideas on how to get Launchbox to close Xpadder when I quit ParaJVE? Pretty please??

 

Edit:

Windows 10 fully updated

Launchbox Premium fully updated

Xpadder 2014.01.01

Edited by launcherbox
Link to comment
Share on other sites

Thanks very much for the help Kondorito. The script you linked to above (once I have changed the paths to Xpadder.exe) will indeed start Xpadder, but will not close it when ParaJVE closes ? The best I can reason is that Launchbox has difficulty in recognizing that ParaJVE has closed as a process

Link to comment
Share on other sites

14 minutes ago, launcherbox said:

Thanks very much for the help Kondorito. The script you linked to above (once I have changed the paths to Xpadder.exe) will indeed start Xpadder, but will not close it when ParaJVE closes ? The best I can reason is that Launchbox has difficulty in recognizing that ParaJVE has closed as a process

Maybe post this in that topic, somebody will surely give you a hand with it (I am not ahk knowledgeable enough :) ). 

Link to comment
Share on other sites

Ok, just for the sake of completion and if anyone else ever has this problem, I've figured it out. Basically, the best I can deduce is that because the version of AHS within Launchbox closes when LB closes, it's not persistent (meaning the second the emulator is closed, AHS closes too, leaving it unable to fulfill tasks post emulator shutdown). How I got around this is as follows:

 

1) We need to run AHS independently of LB, so we can control it beyond emulator shutdown. So first, you need to create your own .txt file, and give it a name like myscript.ahk. You then edit this file (I use Notepad++), and I inserted this code:

#SingleInstance, Force
#Persistent
SetTitleMatchMode, 2
DetectHiddenWindows, On
 
SetTimer, ProcessCheckTimer, 2000
Return
 
ProcessCheckTimer:
Process, Exist, javaw.exe
pid1 := ErrorLevel
If (!pid1)
         {
	 Run, F:\Tools\Xpadder-v2014.01.01\Xpadder\Xpadder.exe /C
         ExitApp
         }



*the path to Xpadder will need to be adapted to your own installation path

 

In essence, what's happening here is that the process javaw.exe is being checked to see if it's running (ParaJVE runs under Java), and when it's not found to be running (as in when you exit the emu), the Xpadder shutdown command is ran. 

2) You need to then use Additional Apps to run Xpadder BEFORE the emu starts by creating a run before app profile under Additional Apps

3) You then create a second instance of an Additional App profile, and for the application .exe path, you point it towards you myscript.ahs. You will also need to associate AHS files within windows, with the AHS application itself found in the Launchbox installation folder.

 

So you basically have told LB to boot Xpadder before the emu starts. You're then telling it to run your new script when the application ends, and this script takes care of shutting down ParaJVE for you, and it all closes nicely. This is probably very convoluted, I don't really know, I've no experience with scripting, but for whatever reason, ParaJVE does not play nicely with LB when you need LB to recognise the emu has shut down. 
 

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