jcnils / protonhax

Run programs inside your game proton's environment.
BSD 3-Clause "New" or "Revised" License
118 stars 7 forks source link

Launching other executables FIRST #5

Closed Hate9 closed 7 months ago

Hate9 commented 2 years ago

Ok, so this is niche as hell, but is there any way I could use this to launch an external executable in a proton instance, and then launch the game?

Because I have a mod that needs to load before the game can, but using this the normal way, the game has to start in order for the proton instance to open for me to launch the external program.

Could I switch the process, and launch the external program via proton, and then launch the game's exe in that's proton instance?

jcnils commented 2 years ago

It is possible, but this script does not have this feature.

You can do that with Lutris or Bottles out of the box if you are in a hurry, as it will take me some time to work on this.

Do you need to interact at all with the external executable before launching the game, or it just need to run first?

Hate9 commented 2 years ago

Yeah, I shouldn't need to interact with the external executable before launching, it just needs to run first so it can modify the multiplayer behavior or something.

jcnils commented 7 months ago

This was a while ago, but I hope this help people in the future.

You can use this in the Steam launch options to run an entirely different executable. And if needed, you can use protonhax to start the game.

eval $(echo "protonhax init %command%" | sed "s|path/to/game.exe|path/to/your.exe|") example https://www.protondb.com/app/368260/

People usually do this to bypass launchers, like 2k, and open the game straight away.

I also saw some people using

bash -c 'exec "${@/path/to/game.exe/path/to/your.exe}"' -- %command% example https://safereddit.com/r/SteamDeck/comments/yqsgks/using_launch_options_to_launch_an_entirely/

I have not tested this last one.