Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Add Stardew Valley Support #593

Closed
wants to merge 9 commits into from
7 changes: 7 additions & 0 deletions gamesinfo/stardewvalley.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
game_steam_subdirectory="Stardew Valley"
game_nexusid="stardewvalley"
game_appid=413150
game_executable="Stardew Valley.exe"
game_smapi_version="4.0.6"
game_scriptextender_url="https://github.com/Pathoschild/SMAPI/releases/download/${game_smapi_version}/SMAPI-${game_smapi_version}-installer.zip"
game_scriptextender_files=""
1 change: 1 addition & 0 deletions step/select_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ selected_game=$( \
"skyrim" "Skyrim" \
"skyrimspecialedition" "Skyrim Special Edition" \
"skyrimvr" "Skyrim VR" \
"stardewvalley" "Stardew Valley" \
)

if [ -z "$selected_game" ]; then
Expand Down
9 changes: 9 additions & 0 deletions utils/protontricks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ function get_prefix() {
fi
}

function run_command() {
appid=$1; shift
do_protontricks -c "$@" $appid
return $?
}

action=$1
shift

Expand All @@ -69,6 +75,9 @@ case "$action" in
apply)
apply "$@"
;;
run-command)
run_command "$@"
;;
*)
log_error "invalid action '$action'"
exit 1
Expand Down
19 changes: 19 additions & 0 deletions workarounds/stardewvalley.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# Install SMAPI
if [ -d "$extracted_scriptextender" ]; then
log_info "installing SMAPI in '$game_installation'"

# This command is ugly, but necessary
# Needs to run through wineconsole in order to work with .NET's System.Console

"$utils/protontricks.sh" run-command "$game_appid" "wineconsole '${extracted_scriptextender}/SMAPI ${game_smapi_version} installer/internal/windows/SMAPI.Installer.exe' --install --no-prompt --game-path 'Z:\mnt\lingames\SteamLibrary\steamapps\common\Stardew Valley'" \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --game-path parameter seems to be hard-coded to a specific location in your system, which isn't a portable solution.
The "game_installation" variable set by load_gameinfo.sh will hold the install location. This should convert it to a Windows path:

echo "$game_installation" | sed -e 's/^/Z:/' -e 's@/@\\@g'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, the path was definitely a mistake on my part. Rushed from the yelling at the computer phase to the clean up for pull request phase. 😛

| "$dialog" loading "Installing SMAPI\nThis may take a while"

if [ "$?" != "0" ]; then
"$dialog" errorbox \
"Error while installing SMAPI, check the terminal for more details"
exit 1
fi

fi
Loading