Created
January 10, 2021 14:43
-
-
Save denisoster/48a7506c7d11f3efba3c5235cde6301d to your computer and use it in GitHub Desktop.
Run another exe file from steam proton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
game_id=$1 | |
game_folder=$2 | |
executable_file=$3 | |
### Checks | |
if [ -z "$game_id" ] || [ -z "$game_folder" ] || [ -z "$executable_file" ]; then | |
echo "Example: ./proton_exec.sh 211600 thief_gold \$HOME/executable_file.exe" | |
fi | |
if [ -z "$game_id" ]; then | |
echo "Need app id game from steam" | |
exit 1 | |
fi | |
if [ -z "$game_folder" ]; then | |
echo "Need folder name for game" | |
exit 1 | |
fi | |
if [ -z "$executable_file" ]; then | |
echo "Need full path to executable file" | |
exit 1 | |
fi | |
### Preparation | |
steamapps_path="$HOME/.local/share/Steam/steamapps" | |
game_path="$steamapps_path/common/$game_folder" | |
compatdata_path="$steamapps_path/compatdata/$game_id" | |
pfx="$compatdata_path/pfx" | |
proton_version_source=$(<$compatdata_path/version) | |
proton_version=${proton_version_source%-*} | |
wine64="$HOME/.local/share/Steam/steamapps/common/Proton $proton_version/dist/bin/wine64" | |
### Execution | |
cd "$pfx/drive_c/Program Files (x86)" | |
ln -sf $game_path . | |
"$wine64" "$executable_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment