2012-07-21, 09:35
(2012-07-21, 04:11)Angelscry Wrote: Another possibility you can try is to close/start the windows's explorer.exe process instead of using the TaskBarHider.exe application. You cannot really use here the ProcessWaitClose() here because you must stay into an infinite loop where XMBC.exe and launcher.exe could be closed. The If Not ProcessExists() seems working here, because you are able to exit from the while loop. Have you really renamed all your launcher autoit script as launcher.exe? And have you change your Advanced Launcher applications parameters in concequences? Because is you are able to exit the while loop, that mean that XBMC.exe and launcher.exe are not runnig at the same time. Your problem could be related to your launcher.exe script : for example the XBMC process may not have have enough time to really start when the launcher.exe process is closed... Maybe adding a ProcessWait() at the and of the launcher.exe script will solve the problem :
Code:...
Run ( '"C:\Program Files (x86)\XBMC\XBMC.exe"' )
ProcessWait ("XBMC.exe")
Exit 0
...
Ok, I have found one of the problems. My custom launcher for XBMC was named XBMC.exe. My custom launchers for the emulators call for process XBMC.exe to close instead of suspending it, to avoid the title bar issue. This was not only closing the real XBMC.exe process but also closing the XBMC.exe custom launcher as well. I had renamed all my launchers except the most important one, xbmc's launcher! This was a really foolish mistake and I can't believe I didn't think of it before. Sorry about wasting your time on that.
The idea to close explorer.exe is a really good one. I've tried it, but it restarts itself the second it is closed by the script. This does not happen if I manually close explorer.exe from the Task Manager. Advanced Launcher settings are correct and the launchers are all named launcher.exe. I think the reason explorer.exe restarts itself instantly is because the loop checks to see if XBMC is running and checks to see if launcher.exe is running, if both are not running at the same time, it calls for the terminate function, which runs nomousy.exe and runs explorer.exe again. The strange part is that while explorer.exe is restarted, my cursor remains hidden until I close XBMC, then it comes back as it should. It seems as though the nomousy part of the script is working properly, but for some reason explorer.exe is being run again as soon as it is closed.
Not sure how to fix this, possibly you were right the first time when using the AND and OR structure? here's my new launcher:
Code:
Run("nomousy.exe /hide", "", @SW_HIDE)
ProcessClose ( "explorer.exe" )
Run ("C:\Program Files (x86)\XBMC\XBMC.exe")
ProcessWait ("XBMC.exe")
While 1
If Not ProcessExists("XBMC.exe") Then
If Not ProcessExists("launcher.exe") Then
Terminate()
EndIf
EndIf
Sleep(100)
Wend
Func Terminate()
Run("nomousy.exe", "", @SW_HIDE)
Run("explorer.exe", "", @SW_HIDE)
Exit 0
EndFunc
(2012-07-21, 04:11)Angelscry Wrote: You don't need to mount the ISO file AND at the same time load it into epsxe. It's one or the other. Not both. You also do not have to use the RunWait() function to start the emulator. This function is to run an external program and to pause script execution until the program finishes. You also need to unmount the ISO when exiting the script, so... it must be located into the Terminate() function. Finally your ProcessWait ("dccmd.exe") line had no sens because you previously pause the scrip until dccmd.exe was closed. Try this script :
Code:HotKeySet("{ESC}", "Terminate")
If $CmdLine[0] == 1 Then
ProcessClose ( "XBMC.exe" )
RunWait('"C:\Program Files (x86)\DAEMON Tools Lite\DTLite.exe" -mount 0,"' & $CmdLine[1] & '"', @SW_HIDE)
Run('"G:\xbmc\games\ps\ePSXe.exe" -nogui -cdrom <letter>', "", @SW_HIDE)
While 1
Sleep(100)
WEnd
EndIf
Func Terminate()
ProcessClose ( "ePSXe.exe" )
RunWait('"C:\Program Files (x86)\DAEMON Tools Lite\DTLite.exe" -unmount 0', @SW_HIDE)
RunWait('"C:\Program Files (x86)\12noon Display Changer\dccmd.exe -width=1920 -height=1080"', @SW_HIDE)
Run ( '"C:\Program Files (x86)\XBMC\XBMC.exe"' )
Exit 0
EndFunc
Where <letter> is the drive letter where is mounted you ISO file with Deamon Tools.
I get an error by ePSXe -cdrom parameter invalid. My drive letter is H, I think that command line may be obsolete with 1.6.0 and 1.7.0. Is there another code? I've tried <H> <H:> and <H:\>. I searched ePSXe command line utilities and found this post which claims that the -cdrom parameter is not usable.
Thanks again.