12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env bash
- # Read-only utility script to check for leftover binary files from past installations.
- # This might be helpful to narrow down possible causes of the error 31-4302.
- #
- # Usage: ./find_surplus_finaries.sh
- # Execute the script within the game installation directory.
- per_line_data=$(jq -r "[.remoteName] | join(\"\")" "pkg_version")
- pefiles=$(find . \( -iname '*.exe' -o -iname '*.sys' -o -iname '*.dll' -o -iname "*.blk" -o -iname "*.usm" \))
- echo "List of files not contained in pkg_version"
- echo "Note: Matches in */Persistent/* might be false-positives"
- echo "-------------------"
- count_total=0
- count_bad=0
- while read -r filename; do
- filename=${filename##./}
- if [[ ! "$per_line_data" == *"$filename"* ]]; then
- echo "$filename"
- count_bad=$((count_bad + 1))
- fi
- count_total=$((count_total + 1))
- done <<< "$pefiles"
- echo "-------------------"
- echo "Done. Checked ${count_total} files. ${count_bad} bad file(s)."
|