mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.22k stars 111 forks source link

Sequence of EXEs in launch: command..... Is possible? #1015

Closed fastpop72 closed 1 year ago

fastpop72 commented 2 years ago

I have to add the model2emulator to Pegasus.

The launch command i need to use contains two subsequential EXEs like this:

launch: m2exit.exe && emulator.exe {file.basename}

This command works flawlessly on CMD under Windows but seems Pegasus launch string doesn't support &&.

I don't want to use a .bat file.

Could you add the && support? Thanks.

mmatyas commented 2 years ago

Pegasus runs exactly one command, but that command can be the Windows cmd too – I think it supports evaluating commands as a parameter, but not sure if it needs some extra parameters for that. A wrapper script for m2e itself could be another alternative.

fastpop72 commented 2 years ago

I tried now this line in Command Prompt and works OK:

start /B m2exit.exe && EMULATOR.EXE daytona

But in Pegasus launch: doesn't work, despite it contains only one command (start) and the rest is passed as argument.

CMD.EXE doesn't seem accept arguments....

mmatyas commented 2 years ago

If you've tried this in the command prompt, I assume it interpreted the && by itself, separated the line to two commands, and didn't pass the rest as an argument. Perhaps quoting the whole argument part would work?

fastpop72 commented 1 year ago

Nothing.. quoting doesn't work!

I was forced to create a .bat file with the two commands.

Anyway would be great to implement an extended version of "launch:" in metadata, for example using commands like this:

launch1: xxxxxx launch2: xxxxxxxx launch3: xxxxx etc...

where the commands are executed subsequentially. Could be useful for adding some sort of specific visualization and/or animation before or after executing the game.

mmatyas commented 1 year ago

It seems cmd does accept arguments, for example with /K and /C:

cmd /K "echo hello && echo world"

which prints

hello
world

separately. This might help you as well.

fastpop72 commented 1 year ago

GOTCHA!!

The launch command now works, here's the key:

launch: cmd /C "START /B m2exit.exe && START /B /WAIT EMULATOR.EXE {file.basename}"

At the start it executes the "m2exit.exe" then the emulator. When i exit it returns to Pegasus.

Thanks.

mmatyas commented 1 year ago

Great! I'll add a note about this to the documentation.