Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions scripts/get-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ TMP_DIR="$HOME/GeneralsX/.steamcmd_zh"

mkdir -p "$TMP_DIR" "$DEST"

# macOS Gatekeeper quarantines steamcmd's unnotarized bundled frameworks
# (e.g. Breakpad.framework) when Homebrew installs the cask. On first run that
# pops a blocking "Apple could not verify ... malware" dialog that stops
# steamcmd dead. Clear the quarantine flag off the steamcmd install up front.
if [[ "$(uname)" == "Darwin" ]] && command -v brew >/dev/null 2>&1; then
STEAMCMD_CASK="$(brew --prefix)/Caskroom/steamcmd"
[[ -d "$STEAMCMD_CASK" ]] && xattr -dr com.apple.quarantine "$STEAMCMD_CASK" 2>/dev/null || true
fi

# steamcmd and the Steam desktop client share one data directory
# (~/Library/Application Support/Steam on macOS, ~/.steam on Linux). When the
# desktop client is running it holds a single-instance lock, so steamcmd stalls
# forever right after printing "Verifying installation..." — no error, just a
# silent hang. Fail fast with an actionable message instead.
if pgrep -x steam_osx >/dev/null 2>&1 \
|| pgrep -f 'Steam.AppBundle' >/dev/null 2>&1 \
|| pgrep -x steam >/dev/null 2>&1; then
echo "Error: the Steam desktop client is running." >&2
echo "steamcmd shares Steam's data directory, and the running client locks it —" >&2
echo 'steamcmd would hang forever after "Verifying installation...".' >&2
echo "Quit Steam completely (Steam > Quit Steam, or Cmd-Q on macOS), then re-run this script." >&2
exit 1
fi

# App 2732960 = C&C Generals Zero Hour (Windows depot; assets are platform-independent)
steamcmd \
+@sSteamCmdForcePlatformType windows \
Expand Down