From 78fc70f59915b1ad57a7915c0f24479125946b0c Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:57:33 -0400 Subject: [PATCH] Improvements to non-lutris install process --- lug-helper.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 886084e..06a2713 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -2576,17 +2576,24 @@ install_game_wine() { # Create a temporary log file tmp_install_log="$(mktemp --suffix=".log" -t "lughelper-install-XXX")" - # Create the new prefix + debug_print continue "Installation log file created at $tmp_install_log" + + # Create the new prefix and install powershell export WINEPREFIX="$install_dir" - debug_print continue "Preparing the wine prefix..." - winecfg -v win11 >"$tmp_install_log" 2>&1 && + debug_print continue "Preparing the wine prefix. Please wait; this will take a moment..." + "$winetricks_bin" -q arial tahoma dxvk powershell win11 >>"$tmp_install_log" 2>&1 + + if [ "$?" -eq 1 ]; then + if message question "Wine prefix creation failed. Aborting installation.\nThe install log was written to\n$tmp_install_log\n\nDo you want to delete\n${install_dir}?"; then + debug_print continue "Deleting $install_dir..." + rm -r --interactive=never "$install_dir" + fi + wineserver -k + return 1 + fi # Add registry key that prevents wine from creating unnecessary file type associations - wine reg add "HKEY_CURRENT_USER\Software\Wine\FileOpenAssociations" /v Enable /d N /f >"$tmp_install_log" 2>&1 - - # Install powershell - debug_print continue "Installing wine components. Please wait; this will take a moment..." - "$winetricks_bin" -q arial tahoma dxvk powershell >>"$tmp_install_log" 2>&1 + wine reg add "HKEY_CURRENT_USER\Software\Wine\FileOpenAssociations" /v Enable /d N /f >>"$tmp_install_log" 2>&1 # Run the installer debug_print continue "Installing the launcher. Please wait; this will take a moment..." @@ -2594,7 +2601,7 @@ install_game_wine() { if [ "$?" -eq 1 ]; then # User cancelled or there was an error - if message question "Installation aborted. The install log was written to\n"$tmp_install_log"\n\nDo you want to delete\n${install_dir}?"; then + if message question "Installation aborted. The install log was written to\n$tmp_install_log\n\nDo you want to delete\n${install_dir}?"; then debug_print continue "Deleting $install_dir..." rm -r --interactive=never "$install_dir" fi @@ -2673,7 +2680,7 @@ install_game_wine() { rsi_path="$(echo "$rsi_path" | sed 's|\\|\\\\|g')" fi - message info "Installation has finished. The install log was written to "$tmp_install_log"\n\nNext Steps:\n\n1. Easy Anticheat Fix: Paste this Game Location into the RSI Launcher's settings:\n $rsi_path\n\n2. To start the RSI Launcher, run the following launch script in a terminal\n Edit the environment variables in the script as needed:\n $installed_launch_script\n\n3. You may also use the following .desktop files if wine installed them:\n $home_desktop_file\n $localshare_desktop_file" + message info "Installation has finished. The install log was written to $tmp_install_log\n\nNext Steps:\n\n1. Easy Anticheat Fix: Paste this Game Location into the RSI Launcher's settings:\n $rsi_path\n\n2. To start the RSI Launcher, run the following launch script in a terminal\n Edit the environment variables in the script as needed:\n $installed_launch_script\n\n3. You may also use the following .desktop files if wine installed them:\n $home_desktop_file\n $localshare_desktop_file" fi }