From 1ba8b0b76967054aa3317e8d07d4966c1e5f617b Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 00:39:05 -0400 Subject: [PATCH 01/23] Initial work on non-lutris install option --- lug-helper.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index e6ff066..3df9a04 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2293,7 +2293,7 @@ maintenance_menu() { # Install Star Citizen using Lutris -install_game() { +install_game_lutris() { # Check if Lutris is installed lutris_detect if [ "$lutris_installed" = "false" ]; then @@ -2342,6 +2342,55 @@ install_game() { fi } +# Install the game without Lutris +install_game_wine() { + if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nAre you ready to continue?"; then + if message question "Would you like to use the default install path?\n\n$HOME/Games/star-citizen"; then + # Set the default install path + install_dir="$HOME/Games/star-citizen" + else + if [ "$use_zenity" -eq 1 ]; then + message info "On the following screen, select your Star Citizen install location.\n\nA new subdirectory named 'star-citizen' will be created in the selected location." + + # Get the install path from the user + install_dir="$(zenity --file-selection --directory --title="Choose your Star Citizen install directory" --filename="$HOME/" 2>/dev/null)" + if [ "$?" -eq -1 ]; then + message error "An unexpected error has occurred. The Helper is unable to proceed." + return 1 + elif [ -z "$install_dir" ]; then + # User clicked cancel + message warning "Installation cancelled." + return 1 + fi + else + # No Zenity, use terminal-based menus + clear + # Get the install path from the user + printf "Enter the desired Star Citizen install path (case sensitive)\nie. /home/USER/Games\n\nA new subdirectory named 'star-citizen' will be created in the location entered.\n\n" + while read -rp "Install path: " install_dir; do + if [ -z "$install_dir" ]; then + printf "Invalid directory. Please try again.\n\n" + elif [ ! -d "$install_dir" ]; then + if message question "That directory does not exist.\nWould you like it to be created for you?\n"; then + break + fi + else + break + fi + done + fi + + # Set the game subdirectory + install_dir="$install_dir/star-citizen" + fi + + # Create the game path + mkdir -p "$install_dir" + + # Download rsi installer to tmp and run with install_dir as prefix + fi +} + # Format some URLs for Zenity format_urls() { if [ "$use_zenity" -eq 1 ]; then @@ -2586,7 +2635,8 @@ while true; do # Configure the menu options preflight_msg="Preflight Check (System Optimization)" - install_msg="Install Star Citizen" + install_msg_lutris="Install Star Citizen (Lutris)" + install_msg_wine="Install Star Citizen (Wine)" runners_msg="Manage Lutris Runners" dxvk_msg="Manage Lutris DXVK Versions" maintenance_msg="Maintenance and Troubleshooting" @@ -2594,9 +2644,9 @@ while true; do quit_msg="Quit" # Set the options to be displayed in the menu - menu_options=("$preflight_msg" "$install_msg" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg") + menu_options=("$preflight_msg" "$install_msg_lutris" "$install_msg_wine" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg") # Set the corresponding functions to be called for each of the options - menu_actions=("preflight_check" "install_game" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit") + menu_actions=("preflight_check" "install_game_lutris" "install_game_wine" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit") # Calculate the total height the menu should be # menu_option_height = pixels per menu option From 84fde4af351e8df0d3f48ad71565dfeee3202b36 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 00:46:06 -0400 Subject: [PATCH 02/23] Rename download variables for clarity --- lug-helper.sh | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 3df9a04..08b16c1 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1389,23 +1389,23 @@ download_install() { fi # Get the filename including file extension - download_file="${download_versions[$1]}" + download_filename="${download_versions[$1]}" # Get the selected item name minus the file extension # To add new file extensions, handle them here and in # the download_select_install function below - case "$download_file" in + case "$download_filename" in *.tar.gz) - download_name="$(basename "$download_file" .tar.gz)" + download_basename="$(basename "$download_filename" .tar.gz)" ;; *.tgz) - download_name="$(basename "$download_file" .tgz)" + download_basename="$(basename "$download_filename" .tgz)" ;; *.tar.xz) - download_name="$(basename "$download_file" .tar.xz)" + download_basename="$(basename "$download_filename" .tar.xz)" ;; *.tar.zst) - download_name="$(basename "$download_file" .tar.zst)" + download_basename="$(basename "$download_filename" .tar.zst)" ;; *) debug_print exit "Script error: Unknown archive filetype in download_install function. Aborting." @@ -1430,7 +1430,7 @@ download_install() { fi # Get the selected download url - download_url="$(curl -s "$contributor_url$query_string" | grep -Eo "\"$search_key\": ?\"[^\"]+\"" | grep "$download_file" | cut -d '"' -f4 | cut -d '?' -f1 | sed 's|/-/blob/|/-/raw/|')" + download_url="$(curl -s "$contributor_url$query_string" | grep -Eo "\"$search_key\": ?\"[^\"]+\"" | grep "$download_filename" | cut -d '"' -f4 | cut -d '?' -f1 | sed 's|/-/blob/|/-/raw/|')" # Sanity check if [ -z "$download_url" ]; then @@ -1439,7 +1439,7 @@ download_install() { fi # Download the item to the tmp directory - debug_print continue "Downloading $download_url into $tmp_dir/$download_file..." + debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." if [ "$use_zenity" -eq 1 ]; then # Format the curl progress bar for zenity mkfifo "$tmp_dir/lugpipe" @@ -1453,8 +1453,8 @@ download_install() { if [ "$?" -eq 1 ]; then # User clicked cancel - debug_print continue "Download aborted. Removing $tmp_dir/$download_file..." - rm --interactive=never "${tmp_dir:?}/$download_file" + debug_print continue "Download aborted. Removing $tmp_dir/$download_filename..." + rm --interactive=never "${tmp_dir:?}/$download_filename" rm --interactive=never "${tmp_dir:?}/lugpipe" return 1 fi @@ -1465,28 +1465,28 @@ download_install() { fi # Sanity check - if [ ! -f "$tmp_dir/$download_file" ]; then + if [ ! -f "$tmp_dir/$download_filename" ]; then # Something went wrong with the download and the file doesn't exist message error "Something went wrong and the requested $download_type file could not be downloaded!" - debug_print continue "Download failed! File not found: $tmp_dir/$download_file" + debug_print continue "Download failed! File not found: $tmp_dir/$download_filename" return 1 fi # Extract the archive to the tmp directory - debug_print continue "Extracting $download_type into $tmp_dir/$download_name..." + debug_print continue "Extracting $download_type into $tmp_dir/$download_basename..." if [ "$use_zenity" -eq 1 ]; then # Use Zenity progress bar - mkdir "$tmp_dir/$download_name" && tar -xf "$tmp_dir/$download_file" -C "$tmp_dir/$download_name" | \ + mkdir "$tmp_dir/$download_basename" && tar -xf "$tmp_dir/$download_filename" -C "$tmp_dir/$download_basename" | \ zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Extracting ${download_type}...\n" 2>/dev/null else - mkdir "$tmp_dir/$download_name" && tar -xf "$tmp_dir/$download_file" -C "$tmp_dir/$download_name" + mkdir "$tmp_dir/$download_basename" && tar -xf "$tmp_dir/$download_filename" -C "$tmp_dir/$download_basename" fi # Check the contents of the extracted archive to determine the # directory structure we must create upon installation num_dirs=0 num_files=0 - for extracted_item in "$tmp_dir/$download_name"/*; do + for extracted_item in "$tmp_dir/$download_basename"/*; do if [ -d "$extracted_item" ]; then num_dirs="$(($num_dirs+1))" extracted_dir="$(basename "$extracted_item")" @@ -1506,25 +1506,25 @@ download_install() { for (( i=1; i<"${#download_dirs[@]}"; i=i+2 )); do # Loop through all download destinations, installing to each one # Odd numbered elements will contain the download destination's path - if [ -d "${download_dirs[i]}/$download_name" ]; then + if [ -d "${download_dirs[i]}/$download_basename" ]; then # This item has already been installed. Delete it before reinstalling - debug_print continue "$download_type exists, deleting ${download_dirs[i]}/$download_name..." - rm -r --interactive=never "${download_dirs[i]:?}/$download_name" - debug_print continue "Reinstalling $download_type into ${download_dirs[i]}/$download_name..." + debug_print continue "$download_type exists, deleting ${download_dirs[i]}/$download_basename..." + rm -r --interactive=never "${download_dirs[i]:?}/$download_basename" + debug_print continue "Reinstalling $download_type into ${download_dirs[i]}/$download_basename..." else - debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_name..." + debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..." fi if [ "$use_zenity" -eq 1 ]; then # Use Zenity progress bar - mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_name/$extracted_dir" "${download_dirs[i]}/$download_name" | \ + mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_basename/$extracted_dir" "${download_dirs[i]}/$download_basename" | \ zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null else - mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_name/$extracted_dir" "${download_dirs[i]}/$download_name" + mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_basename/$extracted_dir" "${download_dirs[i]}/$download_basename" fi done # Store the final name of the downloaded directory - downloaded_item_name="$download_name" + downloaded_item_name="$download_basename" # Mark success for triggering post-download actions download_action_success="installed" elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then @@ -1533,25 +1533,25 @@ download_install() { for (( i=1; i<"${#download_dirs[@]}"; i=i+2 )); do # Loop through all download destinations, installing to each one # Odd numbered elements will contain the download destination's path - if [ -d "${download_dirs[i]}/$download_name" ]; then + if [ -d "${download_dirs[i]}/$download_basename" ]; then # This item has already been installed. Delete it before reinstalling - debug_print continue "$download_type exists, deleting ${download_dirs[i]}/$download_name..." - rm -r --interactive=never "${download_dirs[i]:?}/$download_name" - debug_print continue "Reinstalling $download_type into ${download_dirs[i]}/$download_name..." + debug_print continue "$download_type exists, deleting ${download_dirs[i]}/$download_basename..." + rm -r --interactive=never "${download_dirs[i]:?}/$download_basename" + debug_print continue "Reinstalling $download_type into ${download_dirs[i]}/$download_basename..." else - debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_name..." + debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..." fi if [ "$use_zenity" -eq 1 ]; then # Use Zenity progress bar - mkdir -p "${download_dirs[i]}/$download_name" && cp -r "$tmp_dir"/"$download_name"/* "${download_dirs[i]}"/"$download_name" | \ + mkdir -p "${download_dirs[i]}/$download_basename" && cp -r "$tmp_dir"/"$download_basename"/* "${download_dirs[i]}"/"$download_basename" | \ zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null else - mkdir -p "${download_dirs[i]}/$download_name" && cp -r "$tmp_dir"/"$download_name"/* "${download_dirs[i]}"/"$download_name" + mkdir -p "${download_dirs[i]}/$download_basename" && cp -r "$tmp_dir"/"$download_basename"/* "${download_dirs[i]}"/"$download_basename" fi done # Store the final name of the downloaded directory - downloaded_item_name="$download_name" + downloaded_item_name="$download_basename" # Mark success for triggering post-download actions download_action_success="installed" else @@ -1560,9 +1560,9 @@ download_install() { fi # Cleanup tmp download - debug_print continue "Cleaning up $tmp_dir/$download_file..." - rm --interactive=never "${tmp_dir:?}/$download_file" - rm -r "${tmp_dir:?}/$download_name" + debug_print continue "Cleaning up $tmp_dir/$download_filename..." + rm --interactive=never "${tmp_dir:?}/$download_filename" + rm -r "${tmp_dir:?}/$download_basename" } # List available items for download. Called by download_manage() @@ -1737,16 +1737,16 @@ download_select_install() { continue ;; *.tar.gz) - download_name="$(basename "${download_versions[i]}" .tar.gz)" + download_basename="$(basename "${download_versions[i]}" .tar.gz)" ;; *.tgz) - download_name="$(basename "${download_versions[i]}" .tgz)" + download_basename="$(basename "${download_versions[i]}" .tgz)" ;; *.tar.xz) - download_name="$(basename "${download_versions[i]}" .tar.xz)" + download_basename="$(basename "${download_versions[i]}" .tar.xz)" ;; *.tar.zst) - download_name="$(basename "${download_versions[i]}" .tar.zst)" + download_basename="$(basename "${download_versions[i]}" .tar.zst)" ;; *) # Print a warning and move on to the next item @@ -1760,7 +1760,7 @@ download_select_install() { for (( j=0; j<"${#download_dirs[@]}"; j=j+2 )); do # Loop through all download destinations to get installed types # Even numbered elements will contain the download destination type (ie. native/flatpak) - if [ -d "${download_dirs[j+1]}/$download_name" ]; then + if [ -d "${download_dirs[j+1]}/$download_basename" ]; then installed_types+=("${download_dirs[j]}") fi done @@ -1769,17 +1769,17 @@ download_select_install() { unset menu_option_text if [ "${#download_dirs[@]}" -eq 2 ]; then # We're only installing to one location - if [ -d "${download_dirs[1]}/$download_name" ]; then - menu_option_text="$download_name [installed]" + if [ -d "${download_dirs[1]}/$download_basename" ]; then + menu_option_text="$download_basename [installed]" else # The file is not installed - menu_option_text="$download_name" + menu_option_text="$download_basename" fi else # We're installing to multiple locations if [ "${#installed_types[@]}" -gt 0 ]; then # The file is already installed - menu_option_text="$download_name [installed:" + menu_option_text="$download_basename [installed:" for (( j=0; j<"${#installed_types[@]}"; j++ )); do # Add labels for each installed location menu_option_text="$menu_option_text ${installed_types[j]}" @@ -1788,7 +1788,7 @@ download_select_install() { menu_option_text="$menu_option_text]" else # The file is not installed - menu_option_text="$download_name" + menu_option_text="$download_basename" fi fi # Add the file names to the menu From 519c5ac3f9841f8fa3a082967eb066ad82cd6671 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 01:08:16 -0400 Subject: [PATCH 03/23] Move file download code into function --- lug-helper.sh | 66 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 08b16c1..4c639b6 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1094,6 +1094,47 @@ preflight_check() { ######## begin download functions ########################################## ############################################################################ +# Download a file to the tmp directory +# Expects two arguments, the download URL and the file name +download_file() { + # This function expects two string arguments + if [ "$#" -lt 2 ]; then + printf "\nScript error: The download_file function expects two arguments. Aborting.\n" + read -n 1 -s -p "Press any key..." + exit 0 + fi + + # Capture the arguments + download_url="$1" + download_filename="$2" + + # Download the item to the tmp directory + debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." + if [ "$use_zenity" -eq 1 ]; then + # Format the curl progress bar for zenity + mkfifo "$tmp_dir/lugpipe" + cd "$tmp_dir" && curl -#LO "$download_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!" + stdbuf -oL tr '\r' '\n' < "$tmp_dir/lugpipe" | \ + grep --line-buffered -ve "100" | grep --line-buffered -o "[0-9]*\.[0-9]" | \ + ( + trap 'kill "$curlpid"' ERR + zenity --progress --auto-close --title="Star Citizen LUG Helper" --text="Downloading ${download_type}. This might take a moment.\n" 2>/dev/null + ) + + if [ "$?" -eq 1 ]; then + # User clicked cancel + debug_print continue "Download aborted. Removing $tmp_dir/$download_filename..." + rm --interactive=never "${tmp_dir:?}/$download_filename" + rm --interactive=never "${tmp_dir:?}/lugpipe" + return 1 + fi + rm --interactive=never "${tmp_dir:?}/lugpipe" + else + # Standard curl progress bar + (cd "$tmp_dir" && curl -LO "$download_url") + fi +} + # Detect which version of Lutris is running and restart it lutris_restart() { # Detect the installed versions of Lutris @@ -1439,30 +1480,7 @@ download_install() { fi # Download the item to the tmp directory - debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." - if [ "$use_zenity" -eq 1 ]; then - # Format the curl progress bar for zenity - mkfifo "$tmp_dir/lugpipe" - cd "$tmp_dir" && curl -#LO "$download_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!" - stdbuf -oL tr '\r' '\n' < "$tmp_dir/lugpipe" | \ - grep --line-buffered -ve "100" | grep --line-buffered -o "[0-9]*\.[0-9]" | \ - ( - trap 'kill "$curlpid"' ERR - zenity --progress --auto-close --title="Star Citizen LUG Helper" --text="Downloading ${download_type}. This might take a moment.\n" 2>/dev/null - ) - - if [ "$?" -eq 1 ]; then - # User clicked cancel - debug_print continue "Download aborted. Removing $tmp_dir/$download_filename..." - rm --interactive=never "${tmp_dir:?}/$download_filename" - rm --interactive=never "${tmp_dir:?}/lugpipe" - return 1 - fi - rm --interactive=never "${tmp_dir:?}/lugpipe" - else - # Standard curl progress bar - (cd "$tmp_dir" && curl -LO "$download_url") - fi + download_file "$download_url" "$download_filename" # Sanity check if [ ! -f "$tmp_dir/$download_filename" ]; then From 5d73fce50e5e3989a96b01380223d72e6b151c86 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:58:52 -0400 Subject: [PATCH 04/23] fetch and run rsi installer --- lug-helper.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 4c639b6..826a81c 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -220,19 +220,22 @@ lutris_required="0.5.17" memory_required="16" memory_combined_required="40" -######## Links ############################################################# +######## Links / Versions ################################################## # LUG Wiki lug_wiki="https://starcitizen-lug.github.io" +# NixOS section in Wiki +lug_wiki_nixos="https://github.com/starcitizen-lug/knowledge-base/wiki/Tips-and-Tricks#nixos-tweaks" + +# RSI Installer version +rsi_installer="RSI Launcher-Setup-2.0.2.exe" + # Github repo and script version info repo="starcitizen-lug/lug-helper" releases_url="https://github.com/$repo/releases" current_version="v2.18" -# NixOS section in Wiki -lug_wiki_nixos="https://github.com/starcitizen-lug/knowledge-base/wiki/Tips-and-Tricks#nixos-tweaks" - ############################################################################ ############################################################################ ############################################################################ @@ -2363,6 +2366,12 @@ install_game_lutris() { # Install the game without Lutris install_game_wine() { if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nAre you ready to continue?"; then + # Double check that wine is installed + if [ !-x "$(command -v wine)" ]; then + message error "Wine does not appear to be installed.\nPlease refer to our Quick Start Guide:\n$lug_wiki" + return 1 + fi + if message question "Would you like to use the default install path?\n\n$HOME/Games/star-citizen"; then # Set the default install path install_dir="$HOME/Games/star-citizen" @@ -2405,7 +2414,19 @@ install_game_wine() { # Create the game path mkdir -p "$install_dir" - # Download rsi installer to tmp and run with install_dir as prefix + # Download RSI installer to tmp + download_file "https://install.robertsspaceindustries.com/rel/2/$rsi_installer" "$rsi_installer" + + # Sanity check + if [ ! -f "$tmp_dir/$rsi_installer" ]; then + # Something went wrong with the download and the file doesn't exist + message error "Something went wrong; the installer could not be downloaded!" + debug_print continue "Download failed! File not found: $tmp_dir/$rsi_installer" + return 1 + fi + + # Run the installer + WINEPREFIX="$install_dir" winecfg -v win10 && wine "$tmp_dir/$rsi_installer" fi } From b67cd4a0f5f273d41a32e0b5ddc213c35a0b2c54 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:06:05 -0400 Subject: [PATCH 05/23] update cmd line args --- lug-helper.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 826a81c..0045019 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2541,7 +2541,7 @@ if [ "$#" -gt 0 ]; then printf "Star Citizen Linux Users Group Helper Script Usage: lug-helper -p, --preflight-check Run system optimization checks - -i, --install Install Star Citizen + -i, --install [lutris|wine] Install Star Citizen (default: lutris) -m, --manage-runners Install or remove Lutris runners -k, --manage-dxvk Install or remove DXVK versions -u, --delete-user-folder Delete Star Citizen USER dir, preserve keybinds @@ -2561,7 +2561,17 @@ Usage: lug-helper cargs+=("preflight_check") ;; --install | -i ) - cargs+=("install_game") + install_method="$2" + if [ "$install_method" = "lutris" ] || [ "$install_method" = "LUTRIS" ]; then + cargs+=("install_game_lutris") + elif [ "$install_method" = "wine" ] || [ "$install_method" = "WINE" ]; then + cargs+=("install_game_wine") + else + printf "$0: Invalid argument '%s'\n" "$install_method" + exit 0 + fi + # Shift forward one argument + shift ;; --manage-runners | -m ) cargs+=("runner_manage") From 4191b35f1102249a2c8c09449042d3dec31351b2 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:07:47 -0400 Subject: [PATCH 06/23] Update menu --- lug-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 0045019..b613397 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2684,8 +2684,8 @@ while true; do # Configure the menu options preflight_msg="Preflight Check (System Optimization)" - install_msg_lutris="Install Star Citizen (Lutris)" - install_msg_wine="Install Star Citizen (Wine)" + install_msg_lutris="Install Star Citizen with Lutris" + install_msg_wine="Install Star Citizen with Wine" runners_msg="Manage Lutris Runners" dxvk_msg="Manage Lutris DXVK Versions" maintenance_msg="Maintenance and Troubleshooting" From e869d64a6217c925fd09ccef8677b668210b7abc Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:37:30 -0400 Subject: [PATCH 07/23] Remove extra comment --- lug-helper.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index b613397..9b302d3 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2260,7 +2260,6 @@ display_wiki() { # Delete the helper's config directory reset_helper() { - # Delete the shader directory if message question "All config files will be deleted from:\n\n$conf_dir/$conf_subdir\n\nDo you want to proceed?"; then debug_print continue "Deleting $conf_dir/$conf_subdir/*.conf..." rm --interactive=never "${conf_dir:?}/$conf_subdir/"*.conf From 85f4d6460817cdabe420ef272bdce20dc1b2a92b Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:12:29 -0400 Subject: [PATCH 08/23] Fix if statement --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index 9b302d3..586e7bf 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2366,7 +2366,7 @@ install_game_lutris() { install_game_wine() { if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nAre you ready to continue?"; then # Double check that wine is installed - if [ !-x "$(command -v wine)" ]; then + if [ ! -x "$(command -v wine)" ]; then message error "Wine does not appear to be installed.\nPlease refer to our Quick Start Guide:\n$lug_wiki" return 1 fi From d87c0e55df9187ae177041fa15844375d3a84df4 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:49:29 -0400 Subject: [PATCH 09/23] encode spaces in download urls --- lug-helper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 586e7bf..97f4550 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1107,8 +1107,8 @@ download_file() { exit 0 fi - # Capture the arguments - download_url="$1" + # Capture the arguments and encode spaces in urls + download_url="${1// /%20}" download_filename="$2" # Download the item to the tmp directory @@ -1116,7 +1116,7 @@ download_file() { if [ "$use_zenity" -eq 1 ]; then # Format the curl progress bar for zenity mkfifo "$tmp_dir/lugpipe" - cd "$tmp_dir" && curl -#LO "$download_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!" + cd "$tmp_dir" && curl -#L "$download_url" -o "$download_filename" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!" stdbuf -oL tr '\r' '\n' < "$tmp_dir/lugpipe" | \ grep --line-buffered -ve "100" | grep --line-buffered -o "[0-9]*\.[0-9]" | \ ( @@ -1134,7 +1134,7 @@ download_file() { rm --interactive=never "${tmp_dir:?}/lugpipe" else # Standard curl progress bar - (cd "$tmp_dir" && curl -LO "$download_url") + (cd "$tmp_dir" && curl -#L "$download_url" -o "$download_filename") fi } From 0a829ab22fd37717a9db4ffbe52ee19276d120a1 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:43:34 -0400 Subject: [PATCH 10/23] Fix env var --- lug-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 97f4550..724281a 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2364,7 +2364,7 @@ install_game_lutris() { # Install the game without Lutris install_game_wine() { - if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nAre you ready to continue?"; then + if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nRefer to our Quick Start Guide for prerequisites:\n$lug_wiki\n\nAre you ready to continue?"; then # Double check that wine is installed if [ ! -x "$(command -v wine)" ]; then message error "Wine does not appear to be installed.\nPlease refer to our Quick Start Guide:\n$lug_wiki" @@ -2425,7 +2425,7 @@ install_game_wine() { fi # Run the installer - WINEPREFIX="$install_dir" winecfg -v win10 && wine "$tmp_dir/$rsi_installer" + WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" fi } From c718ff97bd78bbf0825ef058325cfd93076bcc48 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:05:43 -0400 Subject: [PATCH 11/23] Fix up some printf statements --- lug-helper.sh | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 724281a..6ff5841 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -255,16 +255,16 @@ debug_print() { # Echo the provided string and, optionally, exit the script case "$1" in "continue") - printf "\n$2\n" + printf "\n%s\n" "$2" ;; "exit") # Write an error to stderr and exit - printf "lug-helper.sh: $2\n" 1>&2 + printf "%s\n" "lug-helper.sh: $2" 1>&2 read -n 1 -s -p "Press any key..." exit 1 ;; *) - printf "lug-helper.sh: Unknown argument provided to debug_print function. Aborting.\n" 1>&2 + printf "%s\n" "lug-helper.sh: Unknown argument provided to debug_print function. Aborting." 1>&2 read -n 1 -s -p "Press any key..." exit 0 ;; @@ -442,19 +442,19 @@ message() { menu() { # Sanity checks if [ "${#menu_options[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'menu_options' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The array 'menu_options' was not set before calling the menu function. Aborting." elif [ "${#menu_actions[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'menu_actions' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The array 'menu_actions' was not set before calling the menu function. Aborting." elif [ -z "$menu_text_zenity" ]; then - debug_print exit "Script error: The string 'menu_text_zenity' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The string 'menu_text_zenity' was not set before calling the menu function. Aborting." elif [ -z "$menu_text_terminal" ]; then - debug_print exit "Script error: The string 'menu_text_terminal' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The string 'menu_text_terminal' was not set before calling the menu function. Aborting." elif [ -z "$menu_height" ]; then - debug_print exit "Script error: The string 'menu_height' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The string 'menu_height' was not set before calling the menu function. Aborting." elif [ "$menu_type" != "radiolist" ] && [ "$menu_type" != "checklist" ]; then debug_print exit "Script error: Unknown menu_type in menu() function. Aborting." elif [ -z "$cancel_label" ]; then - debug_print exit "Script error: The string 'cancel_label' was not set\nbefore calling the menu function. Aborting." + debug_print exit "Script error: The string 'cancel_label' was not set before calling the menu function. Aborting." fi # Use Zenity if it is available @@ -1220,13 +1220,13 @@ get_lutris_dirs() { post_download() { # Sanity checks if [ -z "$post_download_type" ]; then - debug_print exit "Script error: The string 'post_download_type' was not set\nbefore calling the post_download function. Aborting." + debug_print exit "Script error: The string 'post_download_type' was not set before calling the post_download function. Aborting." elif [ -z "$post_download_msg_heading" ]; then - debug_print exit "Script error: The string 'post_download_msg_heading' was not set\nbefore calling the post_download function. Aborting." + debug_print exit "Script error: The string 'post_download_msg_heading' was not set before calling the post_download function. Aborting." elif [ -z "$post_download_msg" ]; then - debug_print exit "Script error: The string 'post_download_msg' was not set\nbefore calling the post_download function. Aborting." + debug_print exit "Script error: The string 'post_download_msg' was not set before calling the post_download function. Aborting." elif [ -z "$post_download_sed_string" ] && [ "$post_download_type" = "configure-lutris" ]; then - debug_print exit "Script error: The string 'post_download_sed_string' was not set\nbefore calling the post_download function. Aborting." + debug_print exit "Script error: The string 'post_download_sed_string' was not set before calling the post_download function. Aborting." fi # Configure the message heading and format it for zenity @@ -1305,11 +1305,11 @@ download_delete() { # Sanity checks if [ -z "$download_type" ]; then - debug_print exit "Script error: The string 'download_type' was not set\nbefore calling the download_delete function. Aborting." + debug_print exit "Script error: The string 'download_type' was not set before calling the download_delete function. Aborting." elif [ "${#installed_items[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'installed_items' was not set\nbefore calling the download_delete function. Aborting." + debug_print exit "Script error: The array 'installed_items' was not set before calling the download_delete function. Aborting." elif [ "${#installed_item_names[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'installed_item_names' was not set\nbefore calling the download_delete function. Aborting." + debug_print exit "Script error: The array 'installed_item_names' was not set before calling the download_delete function. Aborting." fi # Capture arguments and format a list of items @@ -1342,9 +1342,9 @@ download_delete() { download_select_delete() { # Sanity checks if [ -z "$download_type" ]; then - debug_print exit "Script error: The string 'download_type' was not set\nbefore calling the download_select_delete function. Aborting." + debug_print exit "Script error: The string 'download_type' was not set before calling the download_select_delete function. Aborting." elif [ "${#download_dirs[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_select_delete function. Aborting." + debug_print exit "Script error: The array 'download_dirs' was not set before calling the download_select_delete function. Aborting." fi # Configure the menu @@ -1421,15 +1421,15 @@ download_install() { # Sanity checks if [ "${#download_versions[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_versions' was not set\nbefore calling the download_install function. Aborting." + debug_print exit "Script error: The array 'download_versions' was not set before calling the download_install function. Aborting." elif [ -z "$contributor_url" ]; then - debug_print exit "Script error: The string 'contributor_url' was not set\nbefore calling the download_install function. Aborting." + debug_print exit "Script error: The string 'contributor_url' was not set before calling the download_install function. Aborting." elif [ -z "$download_url_type" ]; then - debug_print exit "Script error: The string 'download_url_type' was not set\nbefore calling the download_install function. Aborting." + debug_print exit "Script error: The string 'download_url_type' was not set before calling the download_install function. Aborting." elif [ -z "$download_type" ]; then - debug_print exit "Script error: The string 'download_type' was not set\nbefore calling the download_install function. Aborting." + debug_print exit "Script error: The string 'download_type' was not set before calling the download_install function. Aborting." elif [ "${#download_dirs[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_install function. Aborting." + debug_print exit "Script error: The array 'download_dirs' was not set before calling the download_install function. Aborting." fi # Get the filename including file extension @@ -1601,11 +1601,11 @@ download_select_install() { # Sanity checks if [ "${#download_sources[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_sources' was not set\nbefore calling the download_select_install function. Aborting." + debug_print exit "Script error: The array 'download_sources' was not set before calling the download_select_install function. Aborting." elif [ -z "$download_type" ]; then - debug_print exit "Script error: The string 'download_type' was not set\nbefore calling the download_select_install function. Aborting." + debug_print exit "Script error: The string 'download_type' was not set before calling the download_select_install function. Aborting." elif [ "${#download_dirs[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_select_install function. Aborting." + debug_print exit "Script error: The array 'download_dirs' was not set before calling the download_select_install function. Aborting." fi # Store info from the selected contributor @@ -1870,15 +1870,15 @@ download_manage() { # Sanity checks if [ -z "$download_sources" ]; then - debug_print exit "Script error: The string 'download_sources' was not set\nbefore calling the download_manage function. Aborting." + debug_print exit "Script error: The string 'download_sources' was not set before calling the download_manage function. Aborting." elif [ "${#download_dirs[@]}" -eq 0 ]; then - debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_manage function. Aborting." + debug_print exit "Script error: The array 'download_dirs' was not set before calling the download_manage function. Aborting." elif [ -z "$download_menu_heading" ]; then - debug_print exit "Script error: The string 'download_menu_heading' was not set\nbefore calling the download_manage function. Aborting." + debug_print exit "Script error: The string 'download_menu_heading' was not set before calling the download_manage function. Aborting." elif [ -z "$download_menu_description" ]; then - debug_print exit "Script error: The string 'download_menu_description' was not set\nbefore calling the download_manage function. Aborting." + debug_print exit "Script error: The string 'download_menu_description' was not set before calling the download_manage function. Aborting." elif [ -z "$download_menu_height" ]; then - debug_print exit "Script error: The string 'download_menu_height' was not set\nbefore calling the download_manage function. Aborting." + debug_print exit "Script error: The string 'download_menu_height' was not set before calling the download_manage function. Aborting." fi # Get the type of item we're downloading from the function arguments From 98e792072a5bb8a22711c9e916ffad2087e61910 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:39:55 -0400 Subject: [PATCH 12/23] Add completion message --- lug-helper.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lug-helper.sh b/lug-helper.sh index 6ff5841..f1e12ef 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2426,6 +2426,8 @@ install_game_wine() { # Run the installer WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" + + message info "Installation has completed! See terminal output for details." fi } From 48d169925fa12b853a02de8cd59426f285b2c02a Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:04:37 -0400 Subject: [PATCH 13/23] Remove wine version --- lib/lutris-starcitizen.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/lutris-starcitizen.json b/lib/lutris-starcitizen.json index 82ffe4c..6675017 100644 --- a/lib/lutris-starcitizen.json +++ b/lib/lutris-starcitizen.json @@ -78,8 +78,7 @@ "prefix_command": "GAMEID=umu-starcitizen STORE=none" }, "wine": { - "system_winetricks": true, - "version": "system" + "system_winetricks": true } } } From b57e1ccaa825186d2d8953a171652956ae8b4bed Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:22:35 -0400 Subject: [PATCH 14/23] install powershell verb --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index f1e12ef..45dc9ad 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2425,7 +2425,7 @@ install_game_wine() { fi # Run the installer - WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" + WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" winetricks powershell && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" message info "Installation has completed! See terminal output for details." fi From 3b7f1ed377c1bd3f290f4f40700730013a24efd2 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:17:13 -0400 Subject: [PATCH 15/23] retrieve download_type --- lug-helper.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 45dc9ad..1eab1fa 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1098,11 +1098,11 @@ preflight_check() { ############################################################################ # Download a file to the tmp directory -# Expects two arguments, the download URL and the file name +# Expects three arguments: The download URL, file name, and download type download_file() { - # This function expects two string arguments - if [ "$#" -lt 2 ]; then - printf "\nScript error: The download_file function expects two arguments. Aborting.\n" + # This function expects three string arguments + if [ "$#" -lt 3 ]; then + printf "\nScript error: The download_file function expects three arguments. Aborting.\n" read -n 1 -s -p "Press any key..." exit 0 fi @@ -1110,6 +1110,7 @@ download_file() { # Capture the arguments and encode spaces in urls download_url="${1// /%20}" download_filename="$2" + download_type="$3" # Download the item to the tmp directory debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." @@ -1483,7 +1484,7 @@ download_install() { fi # Download the item to the tmp directory - download_file "$download_url" "$download_filename" + download_file "$download_url" "$download_filename" "$download_type" # Sanity check if [ ! -f "$tmp_dir/$download_filename" ]; then @@ -2414,7 +2415,7 @@ install_game_wine() { mkdir -p "$install_dir" # Download RSI installer to tmp - download_file "https://install.robertsspaceindustries.com/rel/2/$rsi_installer" "$rsi_installer" + download_file "https://install.robertsspaceindustries.com/rel/2/$rsi_installer" "$rsi_installer" "installer" # Sanity check if [ ! -f "$tmp_dir/$rsi_installer" ]; then @@ -2427,7 +2428,7 @@ install_game_wine() { # Run the installer WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" winetricks powershell && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" - message info "Installation has completed! See terminal output for details." + message info "Installation has completed. See terminal output for details." fi } From e6967e4cb938132ef4fe850ca262f89973e1b583 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:17:34 -0400 Subject: [PATCH 16/23] remove dual_color_blend_by_location --- lib/lutris-starcitizen.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/lutris-starcitizen.json b/lib/lutris-starcitizen.json index 6675017..db6ba82 100644 --- a/lib/lutris-starcitizen.json +++ b/lib/lutris-starcitizen.json @@ -67,7 +67,6 @@ "__GL_SHADER_DISK_CACHE_SIZE": 1073741824, "EOS_USE_ANTICHEATCLIENTNULL": 1, "WINE_HIDE_NVIDIA_GPU": 1, - "dual_color_blend_by_location": "true", "radv_zero_vram": "true", "GAMEID": "umu-starcitizen", "STORE": "none", From 240ec8d0b87e489260896533ba2e5ba6151f2ec1 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:55:29 -0400 Subject: [PATCH 17/23] Update pre-install message --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index 1eab1fa..6aabc38 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2365,7 +2365,7 @@ install_game_lutris() { # Install the game without Lutris install_game_wine() { - if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nRefer to our Quick Start Guide for prerequisites:\n$lug_wiki\n\nAre you ready to continue?"; then + if message question "Before proceeding, be sure all Preflight Checks have passed!\n\nDon't forget to install DXVK!\n\nRefer to our Quick Start Guide for other prerequisites:\n$lug_wiki\n\nAre you ready to continue?"; then # Double check that wine is installed if [ ! -x "$(command -v wine)" ]; then message error "Wine does not appear to be installed.\nPlease refer to our Quick Start Guide:\n$lug_wiki" From 8c7b8cc971249a91f664368f7dd7f83a155ce90c Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:38:38 -0400 Subject: [PATCH 18/23] Add switch prefix and install powershell capabilities --- lug-helper.sh | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 6aabc38..5903c33 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2069,6 +2069,22 @@ version_menu(){ menu } +# Target the Helper at a different Star Citizen prefix/installation +switch_prefix() { + # Check if the config file exists + if [ -f "$conf_dir/$conf_subdir/$wine_conf" ] && [ -f "$conf_dir/$conf_subdir/$game_conf" ]; then + getdirs + if message question "The Helper is currently targeting this Star Citizen install\nWould you like to change it?\n\n$wine_prefix"; then + reset_helper "switchprefix" + # Prompt the user for a new set of game paths + getdirs + fi + else + # Prompt the user for game paths + getdirs + fi +} + # Save exported keybinds, wipe the USER directory, and restore keybinds rm_userdir() { # Prompt user to back up the current keybinds in the game @@ -2261,11 +2277,20 @@ display_wiki() { # Delete the helper's config directory reset_helper() { - if message question "All config files will be deleted from:\n\n$conf_dir/$conf_subdir\n\nDo you want to proceed?"; then + if [ "$1" = "switchprefix" ]; then + # This gets called by the switch_prefix function + # We only want to delete configs related to the game path in order to target a different game install + debug_print continue "Deleting $conf_dir/$conf_subdir/{winedir,gamedir}.conf..." + rm --interactive=never "${conf_dir:?}/$conf_subdir/"{winedir,gamedir}.conf + elif message question "All config files will be deleted from:\n\n$conf_dir/$conf_subdir\n\nDo you want to proceed?"; then + # Called normally by the user, wipe all the things! debug_print continue "Deleting $conf_dir/$conf_subdir/*.conf..." rm --interactive=never "${conf_dir:?}/$conf_subdir/"*.conf message info "The Helper has been reset!" fi + # Also wipe path variables so the reset takes immediate effect + wine_prefix="" + game_path="" } # Show maintenance/troubleshooting options @@ -2281,6 +2306,7 @@ maintenance_menu() { # Configure the menu options version_msg="Switch the Helper between LIVE/PTU/EPTU (Currently: $game_version)" + prefix_msg="Target a different Star Citizen installation" userdir_msg="Delete my user folder and preserve keybinds/characters" shaders_msg="Delete my shaders (Do this after each game update)" vidcache_msg="Delete my DXVK cache" @@ -2289,9 +2315,9 @@ maintenance_menu() { quit_msg="Return to the main menu" # Set the options to be displayed in the menu - menu_options=("$version_msg" "$userdir_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg") + menu_options=("$version_msg" "$prefix_msg" "$userdir_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg") # Set the corresponding functions to be called for each of the options - menu_actions=("version_menu" "rm_userdir" "rm_shaders" "rm_dxvkcache" "display_dirs" "reset_helper" "menu_loop_done") + menu_actions=("version_menu" "switch_prefix" "rm_userdir" "rm_shaders" "rm_dxvkcache" "display_dirs" "reset_helper" "menu_loop_done") # Calculate the total height the menu should be # menu_option_height = pixels per menu option @@ -2432,6 +2458,16 @@ install_game_wine() { fi } +# Install powershell verb into the game's wine prefix +install_powershell() { + if message question "This will install PowerShell into your game's wine prefix.\nNote that this is done automatically for new game installs.\n\nDo you want to continue?"; then + getdirs + debug_print continue "Launching winetricks to install PowerShell into ${wine_prefix}..." + WINEPREFIX="$wine_prefix" winetricks powershell + message info "PowerShell install complete" + fi +} + # Format some URLs for Zenity format_urls() { if [ "$use_zenity" -eq 1 ]; then @@ -2688,6 +2724,7 @@ while true; do preflight_msg="Preflight Check (System Optimization)" install_msg_lutris="Install Star Citizen with Lutris" install_msg_wine="Install Star Citizen with Wine" + powershell_msg="Install PowerShell into Wine prefix" runners_msg="Manage Lutris Runners" dxvk_msg="Manage Lutris DXVK Versions" maintenance_msg="Maintenance and Troubleshooting" @@ -2695,9 +2732,9 @@ while true; do quit_msg="Quit" # Set the options to be displayed in the menu - menu_options=("$preflight_msg" "$install_msg_lutris" "$install_msg_wine" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg") + menu_options=("$preflight_msg" "$install_msg_lutris" "$install_msg_wine" "$powershell_msg" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg") # Set the corresponding functions to be called for each of the options - menu_actions=("preflight_check" "install_game_lutris" "install_game_wine" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit") + menu_actions=("preflight_check" "install_game_lutris" "install_game_wine" "install_powershell" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit") # Calculate the total height the menu should be # menu_option_height = pixels per menu option From edcfcd9eb91c44bca1429bac22b76789ec38c010 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:45:51 -0400 Subject: [PATCH 19/23] Improve wine post-install message --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index 5903c33..33aa719 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2454,7 +2454,7 @@ install_game_wine() { # Run the installer WINEPREFIX="$install_dir" winecfg -v win10 && WINEPREFIX="$install_dir" winetricks powershell && WINEPREFIX="$install_dir" wine "$tmp_dir/$rsi_installer" - message info "Installation has completed. See terminal output for details." + message info "Installation has completed.\n\nNote: Wine may have created the following launcher files on your system\nYou may remove or edit these if desired:\n\n$HOME/Desktop/RSI Launcher.destop\n$HOME/.local/share/applications/wine/Programs/Roberts Space Industries/RSI Launcher.desktop\n\nAfter making changes, update the database by running:\nupdate-desktop-database \$HOME/.local/share/applications" fi } From 284fc1a1b27155e888734bbc499afe125d41ebcf Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:58:48 -0400 Subject: [PATCH 20/23] Update powershell install message --- lug-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 33aa719..4f5acea 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2460,11 +2460,11 @@ install_game_wine() { # Install powershell verb into the game's wine prefix install_powershell() { - if message question "This will install PowerShell into your game's wine prefix.\nNote that this is done automatically for new game installs.\n\nDo you want to continue?"; then + if message question "Run the Preflight Check to update winetricks before proceeding!\n\nDo you want to continue?"; then getdirs debug_print continue "Launching winetricks to install PowerShell into ${wine_prefix}..." WINEPREFIX="$wine_prefix" winetricks powershell - message info "PowerShell install complete" + message info "PowerShell operation complete. See terminal output for details.\n\nIf nothing happened, your winetricks is out of date." fi } From 209a695ba5012c8e4bf73ff25f80accd2b2d674a Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:23:39 -0400 Subject: [PATCH 21/23] Update readme with menu changes --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d048aa8..7aacf46 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,15 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/* - Checks that the hard open file descriptors limit is set to at least 524288. - This limits the maximum number of open files on your system. On some Linux distributions, the default is set too low for Star Citizen. -`Install Star Citizen` +`Install Star Citizen with Lutris` - Launches Lutris and installs Star Citizen +`Install Star Citizen with Wine` +- Installs Star Citizen without Lutris, just using the system Wine + +`Install PowerShell into Wine prefix` +- Uses winetricks to install PowerShell + `Manage Lutris Runners` - Quickly install and delete Lutris wine runners @@ -33,6 +39,9 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/* - `Switch the helper between LIVE/PTU/EPTU` - Target the LIVE, PTU, or EPTU installation for all operations. Defaults to LIVE on each run. +`Target a different Star Citizen installation` +- Select a different wine prefix for the Helper to target in its operations + - `Delete my Star Citizen USER folder and preserve my keybinds` - The helper will make backups of any exported keybinds, delete your Star Citizen USER folder, then restore your keybind files. - To export your keybinds from within the game, go to: @@ -47,18 +56,12 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/* - `Delete my DXVK cache` - A troubleshooting step that sometimes helps fix various issues and crashes. -- `Deploy Global Easy Anti-Cheat Workaround` - - Applies the workaround to /etc/hosts and deletes the necessary EAC files - - `Display Helper and Star Citizen directories` - Show all the directories currently in use by both the Helper and Star Citizen. - `Reset Helper configs` - Delete the configs saved by the helper in *$XDG_CONFIG_HOME/starcitizen-lug/* -- `Show the LUG Wiki` - - Display a link to the LUG Wiki for help with installation and troubleshooting - `Get a random Penguin's Star Citizen referral code` - Display a referral code for a random member of the Star Citizen Linux Users Group. From ed89dde6b05d45ed0a0b640c877bc1e36b400613 Mon Sep 17 00:00:00 2001 From: "the Sane." <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:30:16 -0400 Subject: [PATCH 22/23] Add wiki link --- .github/ISSUE_TEMPLATE/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7257226..45170b6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,7 @@ contact_links: - - name: Community Support and Help + - name: Wiki url: https://starcitizen-lug.github.io - about: Please ask for installation help in our Discord tech support channel. It's bridged to our Matrix space too! + about: Installation issues, troubleshooting, and recent news/changes + - name: Community Support + url: https://discord.gg/meCFYPj + about: Gelp in our Discord tech support channel. It's bridged to our Matrix space too! (See wiki above for links) From 0bd64bd3f15654aeac30867352dca37439235b0a Mon Sep 17 00:00:00 2001 From: "the Sane." <3657071+the-sane@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:32:49 -0400 Subject: [PATCH 23/23] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 3 ++- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9cde3c9..6b52f87 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,7 @@ --- name: Bug report -about: Create a report to help us improve +about: Bugs or issues with the Helper tool. See other options below for non-Helper + related issues title: '' labels: '' assignees: '' diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7..283d0c3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature request -about: Suggest an idea for this project +about: Suggest an idea for improving the Helper tool title: '' labels: '' assignees: ''