mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-16 07:50:34 +00:00
Compare commits
No commits in common. "0de4032a41fd2397f2d4ecbb8ef8885884bb7f3b" and "83a90d35f1415e5cdd99f90d5e757cd0199d92ac" have entirely different histories.
0de4032a41
...
83a90d35f1
108
lug-helper.sh
108
lug-helper.sh
@ -107,9 +107,6 @@ menu_option_height="26"
|
|||||||
# winetricks minimum version
|
# winetricks minimum version
|
||||||
winetricks_required="20220411"
|
winetricks_required="20220411"
|
||||||
|
|
||||||
# lutris minimum version
|
|
||||||
lutris_required="0.5.10.1"
|
|
||||||
|
|
||||||
######## Game Directories ##################################################
|
######## Game Directories ##################################################
|
||||||
|
|
||||||
# The game's base directory name
|
# The game's base directory name
|
||||||
@ -193,7 +190,7 @@ lug_wiki="https://github.com/starcitizen-lug/information-howtos/wiki"
|
|||||||
# Github repo and script version info
|
# Github repo and script version info
|
||||||
repo="starcitizen-lug/lug-helper"
|
repo="starcitizen-lug/lug-helper"
|
||||||
releases_url="https://github.com/$repo/releases"
|
releases_url="https://github.com/$repo/releases"
|
||||||
current_version="v2.2"
|
current_version="v2.1"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -784,70 +781,18 @@ wine_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Detect if lutris is installed
|
|
||||||
lutris_detect() {
|
|
||||||
lutris_installed="false"
|
|
||||||
lutris_native="false"
|
|
||||||
lutris_flatpak="false"
|
|
||||||
|
|
||||||
# Detect native lutris
|
|
||||||
if [ -x "$(command -v lutris)" ]; then
|
|
||||||
lutris_installed="true"
|
|
||||||
lutris_native="true"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Detect flatpak lutris
|
|
||||||
if [ -x "$(command -v flatpak)" ] && flatpak list --app | grep -q Lutris; then
|
|
||||||
lutris_installed="true"
|
|
||||||
lutris_flatpak="true"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check the installed lutris version
|
|
||||||
lutris_check() {
|
|
||||||
lutris_detect
|
|
||||||
|
|
||||||
if [ "$lutris_installed" = "true" ]; then
|
|
||||||
# Check the native lutris version number
|
|
||||||
if [ "$lutris_native" = "true" ]; then
|
|
||||||
lutris_current="$(lutris -v)"
|
|
||||||
if [ "$lutris_required" != "$lutris_current" ] &&
|
|
||||||
[ "$lutris_current" = "$(printf "$lutris_current\n$lutris_required" | sort -V | head -n1)" ]; then
|
|
||||||
preflight_fail+=("Lutris is out of date.\nVersion $lutris_required or newer is required.")
|
|
||||||
else
|
|
||||||
preflight_pass+=("Lutris is installed and up to date.")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check the flatpak lutris version number
|
|
||||||
if [ "$lutris_flatpak" = "true" ]; then
|
|
||||||
lutris_current="$(flatpak run net.lutris.Lutris -v)"
|
|
||||||
if [ "$lutris_required" != "$lutris_current" ] &&
|
|
||||||
[ "$lutris_current" = "$(printf "$lutris_current\n$lutris_required" | sort -V | head -n1)" ]; then
|
|
||||||
preflight_fail+=("Flatpak Lutris is out of date.\nVersion $lutris_required or newer is required.")
|
|
||||||
else
|
|
||||||
preflight_pass+=("Flatpak Lutris is installed and up to date.")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
preflight_fail+=("Lutris does not appear to be installed.\nFor manual installations, this may be ignored.")
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check the installed winetricks version
|
# Check the installed winetricks version
|
||||||
winetricks_check() {
|
winetricks_check() {
|
||||||
if [ -x "$(command -v winetricks)" ]; then
|
if [ -x "$(command -v winetricks)" ]; then
|
||||||
winetricks_current="$(winetricks --version | awk '{print $1}')"
|
winetricks_current="$(winetricks --version | awk '{print $1}')"
|
||||||
if [ "$winetricks_required" != "$winetricks_current" ] &&
|
if [ "$winetricks_required" != "$winetricks_current" ] &&
|
||||||
[ "$winetricks_current" = "$(printf "$winetricks_current\n$winetricks_required" | sort -V | head -n1)" ]; then
|
[ "$winetricks_current" = "$(printf "$winetricks_current\n$winetricks_required" | sort -V | head -n1)" ]; then
|
||||||
preflight_fail+=("Winetricks is out of date.\nVersion $winetricks_required or newer is required.\nIf installing the game through Lutris, this can be ignored.\nCheck that Use System Winetricks is disabled in Lutris Runner Options.")
|
preflight_fail+=("Winetricks is out of date.\nVersion $winetricks_required or newer is required.\nPlease refer to our Quick Start Guide:\n$lug_wiki")
|
||||||
else
|
else
|
||||||
preflight_pass+=("Winetricks is installed and up to date.")
|
preflight_pass+=("Winetricks is installed and up to date.")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
preflight_fail+=("Winetricks does not appear to be installed.\nVersion $winetricks_required or newer is required.\nIf installing the game through Lutris, this can be ignored.\nCheck that Use System Winetricks is disabled in Lutris Runner Options.")
|
preflight_fail+=("Winetricks does not appear to be installed.\nVersion $winetricks_required or newer is required.\nPlease refer to our Quick Start Guide:\n$lug_wiki")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -891,7 +836,6 @@ preflight_check() {
|
|||||||
unset preflight_followup
|
unset preflight_followup
|
||||||
|
|
||||||
# Call the optimization functions to perform the checks
|
# Call the optimization functions to perform the checks
|
||||||
lutris_check
|
|
||||||
wine_check
|
wine_check
|
||||||
winetricks_check
|
winetricks_check
|
||||||
memory_check
|
memory_check
|
||||||
@ -901,8 +845,17 @@ preflight_check() {
|
|||||||
filelimit_check
|
filelimit_check
|
||||||
|
|
||||||
# Populate info strings with the results and add formatting
|
# Populate info strings with the results and add formatting
|
||||||
|
if [ "${#preflight_pass[@]}" -gt 0 ]; then
|
||||||
|
preflight_pass_string="Passed Checks:"
|
||||||
|
for (( i=0; i<"${#preflight_pass[@]}"; i++ )); do
|
||||||
|
preflight_pass_string="$preflight_pass_string\n- ${preflight_pass[i]//\\n/\\n }"
|
||||||
|
done
|
||||||
|
# Add extra newlines if there are also failures to report
|
||||||
|
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
||||||
|
preflight_pass_string="$preflight_pass_string\n\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
||||||
# Failed checks
|
|
||||||
preflight_fail_string="Failed Checks:"
|
preflight_fail_string="Failed Checks:"
|
||||||
for (( i=0; i<"${#preflight_fail[@]}"; i++ )); do
|
for (( i=0; i<"${#preflight_fail[@]}"; i++ )); do
|
||||||
if [ "$i" -eq 0 ]; then
|
if [ "$i" -eq 0 ]; then
|
||||||
@ -911,20 +864,8 @@ preflight_check() {
|
|||||||
preflight_fail_string="$preflight_fail_string\n\n- ${preflight_fail[i]//\\n/\\n }"
|
preflight_fail_string="$preflight_fail_string\n\n- ${preflight_fail[i]//\\n/\\n }"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# Add extra newlines if there are also passes to report
|
|
||||||
if [ "${#preflight_pass[@]}" -gt 0 ]; then
|
|
||||||
preflight_fail_string="$preflight_fail_string\n\n"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "${#preflight_pass[@]}" -gt 0 ]; then
|
|
||||||
# Passed checks
|
|
||||||
preflight_pass_string="Passed Checks:"
|
|
||||||
for (( i=0; i<"${#preflight_pass[@]}"; i++ )); do
|
|
||||||
preflight_pass_string="$preflight_pass_string\n- ${preflight_pass[i]//\\n/\\n }"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
for (( i=0; i<"${#preflight_manual[@]}"; i++ )); do
|
for (( i=0; i<"${#preflight_manual[@]}"; i++ )); do
|
||||||
# Instructions for manually fixing problems
|
|
||||||
if [ "$i" -eq 0 ]; then
|
if [ "$i" -eq 0 ]; then
|
||||||
preflight_manual_string="${preflight_manual[i]}"
|
preflight_manual_string="${preflight_manual[i]}"
|
||||||
else
|
else
|
||||||
@ -943,8 +884,8 @@ preflight_check() {
|
|||||||
message info "$message_heading\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string"
|
message info "$message_heading\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string"
|
||||||
else
|
else
|
||||||
if [ -z "$preflight_action_funcs" ]; then
|
if [ -z "$preflight_action_funcs" ]; then
|
||||||
message warning "$preflight_fail_string$preflight_pass_string"
|
message warning "$preflight_pass_string$preflight_fail_string"
|
||||||
elif message question "$preflight_fail_string$preflight_pass_string\n\nWould you like configuration issues to be fixed for you?"; then
|
elif message question "$preflight_pass_string$preflight_fail_string\n\nWould you like configuration issues to be fixed for you?"; then
|
||||||
# Call functions to build fixes for any issues found
|
# Call functions to build fixes for any issues found
|
||||||
for (( i=0; i<"${#preflight_action_funcs[@]}"; i++ )); do
|
for (( i=0; i<"${#preflight_action_funcs[@]}"; i++ )); do
|
||||||
${preflight_action_funcs[i]}
|
${preflight_action_funcs[i]}
|
||||||
@ -1002,6 +943,25 @@ preflight_check() {
|
|||||||
######## begin download functions ##########################################
|
######## begin download functions ##########################################
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
# Detect if lutris is installed
|
||||||
|
lutris_detect() {
|
||||||
|
lutris_installed="false"
|
||||||
|
lutris_native="false"
|
||||||
|
lutris_flatpak="false"
|
||||||
|
|
||||||
|
# Detect native lutris
|
||||||
|
if [ -x "$(command -v lutris)" ]; then
|
||||||
|
lutris_installed="true"
|
||||||
|
lutris_native="true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Detect flatpak lutris
|
||||||
|
if [ -x "$(command -v flatpak)" ] && flatpak list --app | grep -q Lutris; then
|
||||||
|
lutris_installed="true"
|
||||||
|
lutris_flatpak="true"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Restart lutris if necessary
|
# Restart lutris if necessary
|
||||||
lutris_restart() {
|
lutris_restart() {
|
||||||
lutris_detect
|
lutris_detect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user