Skip to content

Instantly share code, notes, and snippets.

@michaelbutler
Last active July 26, 2024 14:06
Show Gist options
  • Save michaelbutler/f364276f4030c5f449252f2c4d960bd2 to your computer and use it in GitHub Desktop.
Save michaelbutler/f364276f4030c5f449252f2c4d960bd2 to your computer and use it in GitHub Desktop.
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe

Where 20920 is the game id.

First you cd (change directory) to the proton prefix in question. If you don't have any custom steam libraries it likely will all be within your home directory. To find it easier you may run find . | grep compatdata from ~/ and when you find it, cd to it.

Real world example:

cd /media/michael/SSDGAMES/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/media/michael/SSDGAMES/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "/home/michael/.steam/root/steamapps/common/Proton 5.0/proton" run \
    ./drive_c/flawless/FlawlessWidescreen.exe

Wstart

Someone in the comments below created a bash script that makes this easier: https://gist.github.com/michaelbutler/f364276f4030c5f449252f2c4d960bd2?permalink_comment_id=3921629#gistcomment-3921629

@sabi1
Copy link

sabi1 commented May 9, 2022

If I try that, I get a black screen with barely anything being displayed.

@noabody
Copy link

noabody commented May 10, 2022

If you're talking about wstart, that shouldn't happen when properly configured. I wasn't entirely correct when I said you can't run another program within a proton prefix. With the way wstart is currently setup, it should work just fine. The tricky bit is that you have to do it after the Steam program is launched.

So the order of operation is this:

  • Launch Steam program and be sure you are aware of which proton version it is running against, assuming more than one is installed
  • Use wstart to select the same version, then the program to run alongside

I have Elder Scrolls Oblivion installed on my computer. It's actually using proton-ge. I also have the stand-alone version of 32-bit 7zip extracted to my Downloads folder. After I launch Oblivion, I alt-tab to get back to Linux (some games don't alt-tab well, so try to run it windowed instead). In the command shell I type wstart -pp Downloads/7zip/7zFM.exe or just wstart -pp Downloads/7zip, choose the option for proton-ge, then a menu is displayed that shows existing Steam versions (wine prefixes):

1493710  Proton Experimental
1887720  Proton 7.0
22320  The Elder Scrolls III: Morrowind
22330  The Elder Scrolls IV: Oblivion 
489830  The Elder Scrolls V: Skyrim Special Edition
1) 0/pfx	3) 1580130/pfx	5) 22320/pfx	7) 489830/pfx
2) 1493710/pfx	4) 1887720/pfx	6) 22330/pfx	8) quit
Please enter your choice:

I select 6 for 22330/pfx since it matches 22330 The Elder Scrolls IV: Oblivion
Voila, 7zip file manager is running alongside Oblivion. We can verify this by running wstart -pc which eventually brings up a menu:

1) Command Prompt      4) Task Manager	      7) quit
2) Control Panel       5) Windows Explorer
3) Registry Editor     6) Wine Configuration
Please enter your choice:

Choose 4 for Task manager and both programs are running together.
oblv_7z

@ThomasEricB
Copy link

@noabody Could you make a Steam Deck version for this?

@tuxtergames
Copy link

@noabody Could you make a Steam Deck version for this?

hey buddy, you'l try steamtinkerlaunch, solve my all problems

@ThomasEricB
Copy link

hey buddy, you'l try steamtinkerlaunch, solve my all problems

I couldn't get it working with Ultrawide Fix for Yakuza 3 because that requires to launch another .exe... I am at a loss on what I should do

@tuxtergames
Copy link

hey buddy, you'l try steamtinkerlaunch, solve my all problems

I couldn't get it working with Ultrawide Fix for Yakuza 3 because that requires to launch another .exe... I am at a loss on what I should do

maybe its could help, its in pt-br but you can follow the steps, I did this to launch another exe before launch the game here https://www.youtube.com/watch?v=nl2VgTQJUD8&t=254s

@ThomasEricB
Copy link

maybe its could help, its in pt-br but you can follow the steps, I did this to launch another exe before launch the game here https://www.youtube.com/watch?v=nl2VgTQJUD8&t=254s

Good thing I'm a Brazilian! Obrigado

@cprn
Copy link

cprn commented Apr 5, 2023

Just wanted to say Protontricks already does that.

Either use a dedicated script that comes with Protontricks and displays a list of all wine prefixes known to Steam letting you select the right one:

protontricks-launch ~/Downloads/my.exe

or run a command that sets environment variables for you:

protontricks <steam_appid> shell
# whatever you run next runs in correct proton prefix, e.g.:
proton ~/Downloads/my.exe

@Proton6959
Copy link

Proton6959 commented Jun 15, 2023

@cprn
Doesn't work for me. I get the following error messages:
01b8:err:fsync:fsync_init Server is running with WINEFSYNC but this process is not, please enable WINEFSYNC or restart wineserver.

or

Traceback (most recent call last):
  File "/usr/bin/protontricks-launch", line 33, in <module>
    sys.exit(load_entry_point('protontricks==1.7.0', 'console_scripts', 'protontricks-launch')())
  File "/usr/lib/python3/dist-packages/protontricks/cli/launch.py", line 18, in cli
    main(args)
  File "/usr/lib/python3/dist-packages/protontricks/cli/util.py", line 143, in wrapper
    return cli_func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/protontricks/cli/launch.py", line 152, in main
    cli_main(cli_args)
  File "/usr/lib/python3/dist-packages/protontricks/cli/util.py", line 143, in wrapper
    return cli_func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/protontricks/cli/main.py", line 264, in main
    proton_app = find_proton_app(
  File "/usr/lib/python3/dist-packages/protontricks/steam.py", line 624, in find_proton_app
    tool_app = find_steam_compat_tool_app(
  File "/usr/lib/python3/dist-packages/protontricks/steam.py", line 537, in find_steam_compat_tool_app
    tool_appid = get_tool_appid(compat_tool_name, appinfo_path)
  File "/usr/lib/python3/dist-packages/protontricks/steam.py", line 418, in get_tool_appid
    vdf_sections = get_appinfo_sections(appinfo_path)
  File "/usr/lib/python3/dist-packages/protontricks/steam.py", line 385, in get_appinfo_sections
    raise SyntaxError("Invalid file magic number")
SyntaxError: Invalid file magic number

Any idea how I can fix this?

@cprn
Copy link

cprn commented Jun 15, 2023

@Proton6959

enable WINEFSYNC or restart wineserver

@Proton6959
Copy link

@cprn
It is enabled. This happens after I start the game and then run protontricks-launch ~/Downloads/my.exe in the terminal.

@cprn
Copy link

cprn commented Jun 17, 2023

@Proton6959 If the exec file is supposed to be run in the same process layer as the game then try one of the other methods - if it doesn't work, then IDK man, sorry. Either this:

protontricks-launch --appid <steam_appid> ~/Downloads/my.exe

or this:

protontricks <steam_appid> shell   # use Steam appid of the game
path/to/your/proton ~/Downloads/my.exe

Maybe there's something in protontricks-launch --help that'll help you.

@tuxtergames
Copy link

hey fellows, try steamtinkerlaunch, its more simple to use another .exe inside steam.....

@maplepy
Copy link

maplepy commented Jan 6, 2024

hey fellows, try steamtinkerlaunch, its more simple to use another .exe inside steam.....

explain how?

@tuxtergames
Copy link

hey fellows, try steamtinkerlaunch, its more simple to use another .exe inside steam.....

explain how?

here, its in braziliam porttuguese but just follow the steps, I use here for pes21, eutro truck and american truck to run pickup inside the prefix

@maplepy
Copy link

maplepy commented Jan 7, 2024

Thanks man :)

to run pickup

what is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment