RetroFE forums
General Category => General Discussion & Help => Topic started by: ginzu on February 02, 2017, 08:25:40 AM
-
Hello everybody! ;)
(i am in the right forum this time)
I have an issue when i Want to launch my TTX games.
I use Lnk shortcuts as extension type for my games.
This issue occur only with the Lnk shortcuts coming from a .bat file. If i launch a shortcut directly from an exe file, it is working fine and launch the game properly
The problem is that i have to use some bat files because some games need to be launched with a préfix in the command line example: typex_loader game.exe
Retrofe stay in the background (i hear the intro music continuing playing or a bug occur)
Then when i stop the game, retrofe make an appcrash
Any Help would be appreciated
Thank you. ::)
:P
-
Can you post your log.txt file, please?
Sent from my SM-G920F using Tapatalk
-
Hi Pieter,
:) of course, i can :
i attach it to this post, thank you ;)
ginzu
-
I noticed 2 things:
1. You're running RetroFE 0.7.2-beta; we're currently on 0.7.19, and 0.7.20 should become available soon.
2. You're executing a link rather than a batch script. I'm not sure if it would make a difference if you were to run a batch script in stead.
Could you upload your batch script as well?
My guess is that the execution of the link to the batch script returns immediately, making RetroFE think that it can continue its work. If the problem persists with the latest RetroFE releases I'll see what I can find regarding that problem.
-
ok, thanks for your analysis.
i was wondering if i have to upgrade the retroFe revison to one stable revision.
I will upgrade it to the 0.7.19 first.
i attached the bat.file (i have already try to launch it directly from the bat.file (no shortcut and adding the bat extension type in the settings.conf) at this time i used the root path in the bat file to match the correct path of the game of course) => but the game won't launch (no bug, it just won't launch).
ginzu ???
-
i tried the 0.7.19 rev but it's still the same issue ???
-
What happens when you run the batch script from the command line? Do you immediately get your prompt back?
Sent from my SM-G920F using Tapatalk
-
Hello,
If i open a command line terminal (CMD) and send the bat file from its directoy, it launch the game properly
same thing on the lnk from the same bat file
do i have well understand what you want i do as a test? :P :P :o
thank
-
When RetroFE launches another program, it gets a "handle" from the OS that it can use to wait for that program to exit. While it's waiting for the program to exit, it doesn't do much, but when it detects the exit it logs that it's "Finished" and goes on doing its front-end stuff. From your log.txt, it's apparent that it detects an immediate exit of the program that it launched; the "Finished" log timestamp is the same as the one where it launched the program. As far as it knows, your game is over and it is doing what it's supposed to do. The crash is definitely not what it's supposed to do, but we'll have to figure out how to reproduce that in order to fix it.
Meanwhile, it may be possible to bypass the batch files and links altogether and just have RetroFE run the "typex_loader game.exe" line by itself. In your launcher config, try using typex_loader as the executable and the game.exe as the argument. You may need to experiment a bit with the command line and directory settings to make the loader happy, but I think there's likely to be a combination of settings that will work.
-
Hello PinealServo :)
Thank you to trying to help me
i am not sure to have understood what you told me but, here is what i do after i read your post:
Here you can see what is my launcher file.conf for TTX.Games:
the Red line is what i tried but the test doesn't work: the game won't launch (no bug)
#executable = C:\Windows\System32\cmd.exe
executable = F:\JEUX\TTX GAMES\SFIV EXPORT\typex_loader.exe
arguments = /c "%ITEM_FILEPATH%"
and of course, in the rom directory i add the game.exe directly inside to complete the command line. ::)
is that you had in mind? :P
-
if i understand,
RetroFe necessarily need the cmd.exe to execute exe.file
How could i tell to RetroFe to launch cmd.exe and an other exe at the same time?
here is the End of the log file.txt :
[2017-02-03 10:10:44] [ERROR] [Launcher] Failed to run: F:\JEUX\TTX GAMES\SFIV EXPORT\typex_loader.exe
[2017-02-03 10:10:44] [INFO] [Launcher] Completed
[2017-02-03 10:10:44] [ERROR] [Launcher] Failed to launch.
[2017-02-03 10:10:46] [INFO] [Launcher] Checking to see if "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\Ttxshell.exe.lnk" exists [Yes]
[2017-02-03 10:10:46] [INFO] [Launcher] Attempting to launch: "F:\JEUX\TTX GAMES\SFIV EXPORT\typex_loader.exe" /c "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\Ttxshell.exe.lnk"
[2017-02-03 10:10:46] [INFO] [Launcher] from within folder: F:\JEUX\TTX GAMES\SFIV EXPORT
[2017-02-03 10:10:46] [ERROR] [Launcher] Failed to run: F:\JEUX\TTX GAMES\SFIV EXPORT\typex_loader.exe
[2017-02-03 10:10:46] [INFO] [Launcher] Completed
[2017-02-03 10:10:46] [ERROR] [Launcher] Failed to launch.
[2017-02-03 10:11:01] [INFO] [SDL] DeInitializing
[2017-02-03 10:11:01] [INFO] [RetroFE] Exiting
-
ah and also,
i specify that i try with and without the "/c" from the argument line
it gave me an error too.
-
Going back to the batch script idea:
Perhaps you could try start /wait in front of the command? See http://stackoverflow.com/questions/13257571/call-command-vs-start-with-wait-option
-
PHulshoff,
I tried this in the bat file:
START /wait typex_loader Ttxshell.exe
but it won't work (same issue).
I must found a solution to launch my games without these bat file... :o but i don't know how..... :o.
any other idea to pass this' typex loader' prefix by an other method? :P
-
I'm afraid not; I'm a Linux user myself. Hopefully the other users here have some more ideas.
-
a little news. ;)
i found a method to launch only a link shortcut without using a bat file.
however it does the same issue.
what we can say is this is not a problem of bat file but a problem that we need to launch 2 exe one following an other. i think retrofe though ( ;D ).. that i launch a game then, i stop it immediately but the first exe call the second exe immediately and this cause an issue... perheaps i need to put a 'wait' instruction between the two exe in the bat file, i don't know, i'll make a try soon as i can...
I found a new exe : ttx_loader : this loader work like this :
it replace the old typex_loader exe, and to work it need an exe with the folowing name : 'game.exe' in the same directory.
What i have done is i rename the Ttxshell.exe --> game.exe then i deleted the old typex_loader.exe from the same directory
i launched a test, (i only click on the ttx_loder.exe this time... and it launched the game --> ok)
Then i create my shortcut (lnk) and putted it into my rom folder
Then i launched RetroFe and tried to launch the game again but it still the same issue.
ginzu :-\
-
The problem is that your launcher immediately returns after starting the game. I have no idea why it does that or how to stop it from doing that. RetroFE works as expected in this case.
Sent from my SM-G920F using Tapatalk
-
Ok Pieter,
Thank you. If i found a solution , i will post it here.
I know that retrofe work as expected.
I think this ttx_loader somewhere stop himself at the end and retrofe could detect that. If i could tell him to stop only if the game stop, i think it will be ok.
Keep up the good work ;)
-
I've got another idea for you to try:
Instead of launching with a batch script, try a PowerShell script. You should be able to run whatever command necessary to launch the game, then use cmdlets to find the process id of the actual game process and wait for it. Here's documentation on the relevant cmdlets, with some examples: https://msdn.microsoft.com/en-us/powershell/reference/4.0/microsoft.powershell.management/wait-process
I put the following in a file called calc.ps1:
Write-Host Launching calc.exe
Invoke-Item C:\Windows\System32\calc.exe
Write-Host It was launched
$proc_id = (Get-Process calc).id
Wait-Process -id $proc_id
Write-Host It was closed
I then ran it with powershell -file calc.ps1; it printed "It was launched" immediately but then paused until I closed the calculator app, after which it printed "It was closed" and exited back to the prompt.
-
I use this on my Windows retroFE build, and it works perfectly on all games... Hope it helps!
Launcher
executable = %ITEM_DIRECTORY%\Launch.bat
arguments = "%ITEM_FILEPATH%"
Launch.bat (put it into your PC collection rom folder, with the lnks)
@echo off
%1
-
Ok,
It's good to see that there is lot of solution to test!
I have no experience on powershell language, so it is difficult for me to understand.
i made a try with your code PinealServo, but i have no idea , how to adapt it for launching the games, i need more time to understand how it work.
@ KMetalMind ,
Could you explain me a little more how it work?
i made a try too but, when i modify the executable line like in your example, now, retroFe doesn't launch anything...
my hope is your solution work because you said this :
"I use this on my Windows retroFE build, and it works perfectly on all games",
so, i think we are close to get a solution, but i must understand how it work first...
big thanks! :P
-
I´ll elaborate:
Create a new launcher on your launcher folder: whatever.conf. It should have exactly this content:
executable = %ITEM_DIRECTORY%\Launch.bat
arguments = "%ITEM_FILEPATH%"
Check that your collection´s settings.conf is pointing to your launcher.
Create a new .bat file with this content. If you haven´t done it before, you can create a new .txt using Notepad, and rename the file from whatever.txt to Launch.bat.
@echo off
%1
Put the Launch.bat file in the same folder where you have all the links to the PC games, your "roms" folder.
When you launch an item in your collection, the launcher will execute the .bat pointing to your link. The .bat launches the application, and retroFE waits until its finished. Tell me if you still have trouble, as there are plenty .bat code variations in case you still have the problem.
-
Hi KMetalMind,
i tried what you recommand to me to do but it is the same exact situation.
games are launching , but retrofe still continue to play the video on the background.
when i hit the escape button to quit the game, i come back to my desktop and i can see retroFe staying on the task bar ( i hear the video still playing again).
:(
i am on windows 10, this is the only issue i have with retroFe , any other emulators are launching fine.
-
When you launch an item in your collection, the launcher will execute the .bat pointing to your link. The .bat launches the application, and retroFE waits until its finished. Tell me if you still have trouble, as there are plenty .bat code variations in case you still have the problem.
The problem is that these exe files require a specific launcher to do some sort of fixup on them before they'll run, but the launcher itself doesn't keep running once the game starts. RetroFE (or whatever batch file you launch with RetroFE) detects that the launcher has died, but does not realize that there is a new process to wait for.
We need a way to tell the program RetroFE launches directly to keep running until a process other than the one that it starts itself stops running. My PowerShell script shows a way to do this by knowing both the exe/bat/lnk file that launches the game and the process name that represents the game process itself, which will be different from the launcher. The trick is to devise a PowerShell script and a means of launching it from RetroFE with both the pathname of the item that launches the game and the string that will show up in the process list as the name of the game process itself. I don't run RetroFE in Windows myself typically, aside from testing builds, so I'm hoping someone who does can experiment with this technique a bit to get it working right.
I have modified the PowerShell script to take parameters:
param (
[string]$exename,
[string]$procname
)
Write-Host Launching $exename
Invoke-Item $exename
Write-Host It was launched
$proc_id = (Get-Process $procname).id
Wait-Process -id $proc_id
Write-Host It was closed
If you name that pslauncher.ps1
you should be able to call it with parameters like this: powershell -executionpolicy bypass -file C:\RetroFE\pslauncher.ps1 C:\Games\GameDir\FunGameLauncher.lnk FunGame
assuming you replace the pathnames with real ones and use the right name for the game's process name. If the process name of the final game exe ends up being related to the game item name from RetroFE, it should be pretty straightforward to get a launcher configuration set up to use this technique.
The script you pass in the $exename parameter doesn't have to be an exe; it can be anything that will launch a program when you double-click on it, but it has to have the full path. It will probably help if both the $exename and $procname can be derived from something from RetroFE like %ITEM_NAME%, but I have no idea how the Windows process names are actually determined.
-
hello,
i tried this :
i put the pslauncher.ps1 into my rom folder with the commands you gave me inside.
then i went to the launcher directory ta create a new launcher file for my system with the right name of my collection.
then inside this launcher file, i have add this:
executable = powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER
arguments = "%ITEM_FILEPATH%"
the instructions "executable =" and "arguments =" are mandatory.
but after some tries, games won't launch, maybe i don't know how to adapt it more because i don't understand very well the content of the pslauncher.ps1 file.
the end of the log.txt file :
[2017-02-05 11:20:51] [INFO] [Menu] Found: "F:\RetroFE\collections\Main\menu.txt"
[2017-02-05 11:20:56] [INFO] [Layout] Initializing F:\RetroFE\layouts\Flatio 16x9\collections\Taito type X\layout\layout.xml
[2017-02-05 11:20:56] [INFO] [Layout] could not find layout file: F:\RetroFE\layouts\Flatio 16x9\collections\Taito type X\layout\layout.xml
[2017-02-05 11:20:56] [INFO] [CollectionInfoBuilder] Checking for "F:\RetroFE\collections\Taito type X\include.txt"
[2017-02-05 11:20:56] [INFO] [CollectionInfoBuilder] Scanning directory "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER"
[2017-02-05 11:20:56] [INFO] [Menu] Found: "F:\RetroFE\collections\Taito type X\menu.txt"
[2017-02-05 11:21:00] [INFO] [Launcher] Checking to see if "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\StreetFighter 4 Arcade Edition Export.lnk" exists [Yes]
[2017-02-05 11:21:00] [INFO] [Launcher] Attempting to launch: "powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER" "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\StreetFighter 4 Arcade Edition Export.lnk"
[2017-02-05 11:21:00] [INFO] [Launcher] from within folder: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES
[2017-02-05 11:21:00] [ERROR] [Launcher] Failed to run: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER
[2017-02-05 11:21:00] [INFO] [Launcher] Completed
[2017-02-05 11:21:00] [ERROR] [Launcher] Failed to launch.
[2017-02-05 11:21:06] [INFO] [Launcher] Checking to see if "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\StreetFighter 4 Arcade Edition Exportiiiiii.lnk" exists [Yes]
[2017-02-05 11:21:06] [INFO] [Launcher] Attempting to launch: "powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER" "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\StreetFighter 4 Arcade Edition Exportiiiiii.lnk"
[2017-02-05 11:21:06] [INFO] [Launcher] from within folder: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES
[2017-02-05 11:21:06] [ERROR] [Launcher] Failed to run: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER
[2017-02-05 11:21:06] [INFO] [Launcher] Completed
[2017-02-05 11:21:06] [ERROR] [Launcher] Failed to launch.
[2017-02-05 11:21:13] [INFO] [Launcher] Checking to see if "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\King of Fighters 98 Ultimate Match.lnk" exists [Yes]
[2017-02-05 11:21:13] [INFO] [Launcher] Attempting to launch: "powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER" "F:\RetroFE\..\JEUX\TTX GAMES\LAUNCHER\King of Fighters 98 Ultimate Match.lnk"
[2017-02-05 11:21:13] [INFO] [Launcher] from within folder: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES
[2017-02-05 11:21:13] [ERROR] [Launcher] Failed to run: powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER
[2017-02-05 11:21:13] [INFO] [Launcher] Completed
[2017-02-05 11:21:13] [ERROR] [Launcher] Failed to launch.
[2017-02-05 11:21:16] [INFO] [SDL] DeInitializing
[2017-02-05 11:21:16] [INFO] [RetroFE] Exiting
in any case
thank you PinealServo :)
-
executable = powershell -executionpolicy bypass -file F:\JEUX\TTX GAMES\LAUNCHER
arguments = "%ITEM_FILEPATH%"
That seems incorrect?
From what I can see, maybe it should be:
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_FILEPATH%"
You may need to use %ITEM_FILENAME% or %ITEM_NAME% rather than %ITEM_FILEPATH%
-
That seems incorrect?
From what I can see, maybe it should be:
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_FILEPATH%"
You may need to use %ITEM_FILENAME% or %ITEM_NAME% rather than %ITEM_FILEPATH%
That's probably closer to what it needs to be; you'll have to verify the pathname of powershell on your machine and also, the powershell script takes two arguments, which (assuming the game itself is named so that it matches what's in RetroFE) will be %ITEM_FILEPATH% followed by %ITEM_NAME%. The second one is supposed to be the name that shows up in the process list if you open up the task manager tool while the game is running, so it can wait for the real game exe to exit.
-
hey! thank you all to taking your time to help me.
I tested it but as always till now > games won't launch.
::)
I take a look to this page to have a better understanding on the variables : http://www.retrofe.com/wiki/index.php?title=Launchers/Emulators
i test with the 4 following possibilities :
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_FILENAME%"
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_FILEPATH%"
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_DIRECTORY% %ITEM_FILENAME%"
ah and also check if the PATH for Powershell is the right one (it's ok).
AND
executable = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
arguments = -executionpolicy bypass -file F:\Jeux\TTX Games\pslauncher.ps1 "%ITEM_DIRECTORY% %ITEM_NAME%"
sorry, and i don't want to bother any of you too much about this... :-[
-
You should be able to take from the RetroFE log exactly what command it executes and what directory it does it in. Can you tell me what happens if you open a CMD prompt, cd to that directory, and execute the same command that RetroFE does?
-
so, here is what's happening when i launch the same command that does the laucher.conf from the retroFe launcher directory:
i opened a cmd and went to that directory, then i launched the command with the same argument :
F:\RetroFE\launchers>C:\Users\ginzu>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -file "F:\JEUX\TTX GAMES\LAUNCHER\pslauncher.ps1" "%ITEM_FILENAME%"
Accès refusé. <------------- access refused! :o
F:\RetroFE\launchers>
i also make a try with administrator rights on the cmd (i opend a new terminal with admin rights) --> access refused! :o
i don't know how to bypass this situation right now, i must investigate more.
i would also tell that i have made other test too with my fisrt command line (invoking cmd.exe) like this :
this time, i used the "/K" argument :
executable = C:\Windows\System32\cmd.exe
arguments = /K "%ITEM_DIRECTORY% & %ITEM_FILEPATH%"
you know what? it work, .. well almost ;D
when i quit the game : i return into retroFe but retroFe is stuck completely...... :P
(i found that if i kill the correct cmd in the task manager (detail tab) , retroFe run like a charm!
i don't know to add a command line after my code that could help in this case to make running retrofe angain after i quit a game....
to be continued ... ::)
-
PowerShell 1.0 might not support the -executionpolicy flag. You can change the default execution policy by doing the following:
Start powershell from the Start menu or command prompt; you should get a powershell prompt.
At the prompt, type the following command: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Then exit powershell and try launching the script again.
This execution policy change will allow you to run local scripts, but will not run dynamically-downloaded scripts unless they're signed by a trusted certificate.
You also most likely have PowerShell v2 installed; it's the newest version installed by default on Windows 7, and if you have a newer version of Windows, you may have even newer versions of PowerShell. If you find the location of a newer version, try running it with the -executionpolicy flag before you change the default policy setting and see if that works.
The /K flag to cmd.exe tells the shell to stay open after the script finishes. Since the shell is what RetroFE launched, it'll stay paused until you explicitly close the shell. Instead of using the task manager, you could probably alt-tab to it and just exit normally.
-
I'm having the same problems running steam games through .bat file. Video keeps playing in my background. Tried a few suggestions and the closest one was the arguments = /K $rompath$ ... but after exiting the game the frontend just froze. Anyone provide some workaround?
EDIT:
I gave up on this method and just used Rocket Launcher as a default Steam games launcher for retrofe. The issue is fixed this way.
-
Hello my friends,
Sorry for the latter reply, i was really busy,
and thank to Floyd for your comment, in the past my frontend was Hyperspin, but because i met everytime a new bug i leave it completely.
so, unfortunatelly, i never succeeded with any recomandation .... :(
i tried what you told me PinealServo,
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned (on the 2 version of PowerShell i have, but game won't launch and retroFe logs dosen't help much more.
So, i had the idea to create an ahk script :
the idea is quite simple but even there, i didn't succeed to make it work. (i have not enough knowledge to make it work), i passed lot of time to read on autohotkey forum or on the internet and made a lot of tests....
the script must kill a cmd.exe process (or close it) when the escape key is pressed (and permit the exit of the game).
one example of ahk that i tried :
#NoEnv
#SingleInstance, Force
#Persistent
;launch the game : you need to know the ahk_class : run AU3_Spy.exe to know it
Run, StreetFighter 4 Arcade Edition Export.bat
;if windows ahk class is no more existing, --> apply the following instructions:
IfWinNotExist, StreetFighter 4 Arcade Edition Export
;stop (exit) one instance of cmd.exe; take care if there are other instance, only one instance will close.
Process, Close, cmd.exe
;exit the script --> avoid to keep it runing on background
ExitApp
Return
you must understand that this is one of my test, of course i tried with for example :
Esc::Process, Close, cmd.exe
:P
but in this case, the cmd is closed immediately,
often it is like because the game is in fulscreen, the command within the ahk are not executed..........
i tried lot of code with IfWinActive, IfWinExist etc.......... no succes!
is there any expert with ahk somewhere here? :P
the best ahk would be an ahk script that only kill the correct cmd (or at least a cmd process on the exit of the target game exe).
see you ;)
-
OK, well, I think I've found out how to add this "wait for a different exe than the one we launched to close" functionality to RetroFE itself. I'll see if I can get a test program working in Windows and if it's successful, I'll try adding it to RetroFE itself. Might take a little while, though.
-
Hello my friends,
Sorry for the latter reply, i was really busy,
and thank to Floyd for your comment, in the past my frontend was Hyperspin, but because i met everytime a new bug i leave it completely.
I used Hyperspin just for a short span of time and switchedbto retroFe compliteley and I'm glad I did it. I still use retroFe only I've set RetroFe to launch my Steam games through Rocket Launcher.
-
Hi friends! :D
I come with some news,
i found a solution to get rid of this issue! :P however, i can't launch some games but the problem don't come from RetroFe but from these games.
here is the code i use within my ahk script and it work good for SFIV for example:
RunWait typex_loader.exe Ttxshell.exe,,Hide
Sleep 5000 ;We want to give the game a few seconds to load before we monitor it.
WinWaitClose SF41
We must compile it first (autohotkey must be installed on the pc)
then, we just have to put a shortcut (lnk) in the rom section with all the other shortcuts
to summary, this code is not from me but From the famous Howard Casto (thankx to him), someone had the same issue with his frontend several years ago and Howard put this piece of code as a solution.
After that, we just have to adapt the code for each game and give the correct name of the windows or the name of the ahk class. (here it's SF41 in my example).
hope it could help. ;D