From 431ca4f4ca046d0e2f8027a976b0d11c2784c42c Mon Sep 17 00:00:00 2001 From: Diyagi Date: Sat, 28 Feb 2026 20:50:35 -0300 Subject: [PATCH] Fix existing game install not updating --- scripts/setup.sh | 62 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 2c3be56..d035975 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -4,34 +4,54 @@ source "${SCRIPTSDIR}/mod-manager.sh" mkdir -p "${STEAMAPPDIR}" || true -# Initialize arguments array -args=( - "+@sSteamCmdForcePlatformType" "linux" - "+@sSteamCmdForcePlatformBitness" "64" - "+force_install_dir" "$STEAMAPPDIR" - "+login" "anonymous" - "+app_update" "$STEAMAPPID" "validate" - "+app_update" "$STEAMAPPID_TOOL" "validate" -) - -# Override SteamCMD launch arguments if necessary -# Used for subscribing to betas or for testing -if [ -n "$STEAMCMD_UPDATE_ARGS" ]; then - args+=("${STEAMCMD_UPDATE_ARGS[@]}") -fi +NEEDS_VALIDATION=false -# Add the quit command -args+=("+quit") +if [ ! -f "${STEAMAPPDIR}/CoreKeeperServer" ]; then + NEEDS_VALIDATION=true +fi -# Run SteamCMD with the arguments if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then - DepotDownloader -app $STEAMAPPID -osarch 64 -dir $STEAMAPPDIR -validate - DepotDownloader -app $STEAMAPPID_TOOL -osarch 64 -dir $STEAMAPPDIR -validate - chmod +x $STEAMAPPDIR/CoreKeeperServer + app_args=("-app" "$STEAMAPPID" "-osarch" "64" "-dir" "$STEAMAPPDIR") + tool_args=("-app" "$STEAMAPPID_TOOL" "-osarch" "64" "-dir" "$STEAMAPPDIR") + + if [ "$NEEDS_VALIDATION" == true ]; then + app_args+=("-validate") + tool_args+=("-validate") + fi + + DepotDownloader "${app_args[@]}" + DepotDownloader "${tool_args[@]}" + else + args=( + "+@sSteamCmdForcePlatformType" "linux" + "+@sSteamCmdForcePlatformBitness" "64" + "+force_install_dir" "$STEAMAPPDIR" + "+login" "anonymous" + ) + + app_args=("+app_update" "$STEAMAPPID") + tool_args=("+app_update" "$STEAMAPPID_TOOL") + + if [ "$NEEDS_VALIDATION" == true ]; then + app_args+=("validate") + tool_args+=("validate") + fi + + args+=("${app_args[@]}") + args+=("${tool_args[@]}") + + if [ -n "$STEAMCMD_UPDATE_ARGS" ]; then + args+=("${STEAMCMD_UPDATE_ARGS[@]}") + fi + + args+=("+quit") + "$STEAMCMDDIR/steamcmd.sh" "${args[@]}" fi +chmod +x "$STEAMAPPDIR/CoreKeeperServer" + manage_mods exec bash "${SCRIPTSDIR}/launch.sh"