diff --git a/README.md b/README.md index dd08565..811c822 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ The following is a small overview of the current state of each supported game: | Oblivion | working | [some plugins might require manual setup](https://github.com/rockerbacon/lutris-skyrimse-installers/issues/63#issuecomment-643690247) | not tested | | Skyrim | working | working | working | | Skyrim Special Edition | working | working | not tested | +| Stardew Valley | working | [see required post-install steps](https://github.com/rockerbacon/modorganizer2-linux-installer/blob/sdv-support/post-install.md#required-post-install-steps-for-stardew-valley) | N/A | For known bugs and necessary workarounds, please refer to the [issues page](https://github.com/rockerbacon/lutris-skyrimse-installers/issues?q=is:issue+is:open+label:bug+) diff --git a/gamesinfo/stardewvalley.sh b/gamesinfo/stardewvalley.sh new file mode 100644 index 0000000..31ddc84 --- /dev/null +++ b/gamesinfo/stardewvalley.sh @@ -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.7" +game_scriptextender_url="https://github.com/Pathoschild/SMAPI/releases/download/${game_smapi_version}/SMAPI-${game_smapi_version}-installer.zip" +game_scriptextender_files="" diff --git a/post-install.md b/post-install.md index 1919e90..9513466 100644 --- a/post-install.md +++ b/post-install.md @@ -63,3 +63,24 @@ You can pass a single parameter to Mod Organizer 2 through the game's launch opt 5. Close the properties window and launch the game; **IMPORTANT:** pay attention to the usage of single and double quotes in the examples above, as they ensure executable names including spaces will still work. The entire launch option should be wrapped in single quotes and the executable name should be wrapped in double quotes. + +## Required post-install steps for Stardew Valley + +SMAPI requires a console window to run, so we need to make a small tweak to the SMAPI Shortcut. + +1. Open Mod Organizer 2; +2. Click on the cogwheel in the top bar to configure executables: + +![topbar executables config](screenshots/topbar_executables_config.png?raw=true "Executables Configuration") + +3. Click on SMAPI in the list to the left; +4. Move the text in the "Binary" box to the "Arguments" box; +5. In the "Binary" text box, enter: "c:\windows\system32\wineconsole.exe" + +Your config should look similar to this: + +![SMAPI executables list](screenshots/executables_config_SMAPI.png?raw=true "SMAPI Executables List") + +## Updating SMAPI (for Stardew Valley) + +SMAPI can update frequently, and this installer may be a little behind. To change the version of SMAPI installed, simply edit gamesinfo/stardewvalley.sh, and change the variable game_smapi_version to match the version of SMAPI you wish to install. diff --git a/screenshots/executables_config_SMAPI.png b/screenshots/executables_config_SMAPI.png new file mode 100644 index 0000000..d53ed92 Binary files /dev/null and b/screenshots/executables_config_SMAPI.png differ diff --git a/step/select_game.sh b/step/select_game.sh index 268e04a..815f8b4 100644 --- a/step/select_game.sh +++ b/step/select_game.sh @@ -27,6 +27,7 @@ selected_game=$( \ "skyrim" "Skyrim" \ "skyrimspecialedition" "Skyrim Special Edition" \ "skyrimvr" "Skyrim VR" \ + "stardewvalley" "Stardew Valley" \ ) if [ -z "$selected_game" ]; then diff --git a/utils/protontricks.sh b/utils/protontricks.sh index bd2f296..35474c8 100755 --- a/utils/protontricks.sh +++ b/utils/protontricks.sh @@ -56,6 +56,12 @@ function get_prefix() { fi } +function run_command() { + appid=$1; shift + do_protontricks -c "$@" $appid + return $? +} + action=$1 shift @@ -69,6 +75,9 @@ case "$action" in apply) apply "$@" ;; + run-command) + run_command "$@" + ;; *) log_error "invalid action '$action'" exit 1 diff --git a/workarounds/stardewvalley.sh b/workarounds/stardewvalley.sh new file mode 100644 index 0000000..a9a6002 --- /dev/null +++ b/workarounds/stardewvalley.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Install SMAPI +if [ -d "$extracted_scriptextender" ]; then + log_info "installing SMAPI in '$game_installation'" + + game_installation_win=$(echo $game_installation | sed -e 's/^/Z:/' -e 's@/@\\@g') + + # 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 '${game_installation_win}'" \ + | "$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