Refactor Rockstar Games Launcher installation script

This commit is contained in:
Roy
2026-06-09 02:14:21 -07:00
committed by GitHub
parent edfcb32c14
commit 79a7d2a44e
+75 -51
View File
@@ -2723,93 +2723,117 @@ EOF
# Rockstar Games Launcher specific installation steps # Rockstar Games Launcher specific installation steps
function install_rockstar { function install_rockstar {
#Manually Install Rockstar Game Launcher
# Define directories and files set -e
toolsDir=$(dirname "$(readlink -f "$0")")
toolsDir="$(dirname "$(readlink -f "$0")")"
checksumType='sha256' checksumType='sha256'
rstarInstallUnzipFileDir="${logged_in_home}/Downloads/NonSteamLaunchersInstallation/Rockstar" rstarInstallUnzipFileDir="${logged_in_home}/Downloads/NonSteamLaunchersInstallation/Rockstar"
rstarInstallDir="${logged_in_home}/.local/share/Steam/steamapps/compatdata/${appid}/pfx/drive_c/Program Files/Rockstar Games/Launcher" rstarInstallDir="${logged_in_home}/.local/share/Steam/steamapps/compatdata/${appid}/pfx/drive_c/Program Files/Rockstar Games/Launcher"
rstarStartMenuRunShortcutFolder="${logged_in_home}/.local/share/Steam/steamapps/compatdata/${appid}/pfx/drive_c/users/steamuser/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Rockstar Games" rstarStartMenuRunShortcutFolder="${logged_in_home}/.local/share/Steam/steamapps/compatdata/${appid}/pfx/drive_c/users/steamuser/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Rockstar Games"
rstarStartMenuRunShortcut="$rstarStartMenuRunShortcutFolder/Rockstar Games Launcher.lnk" rstarStartMenuRunShortcut="$rstarStartMenuRunShortcutFolder/Rockstar Games Launcher.lnk"
rstarRunTarget="$rstarInstallDir/LauncherPatcher.exe" rstarRunTarget="$rstarInstallDir/LauncherPatcher.exe"
rstarInstallUnzipFile=$rockstar_file
url=$rockstar_url
# Define checksum rstarInstallUnzipFile="$rockstar_file"
url="$rockstar_url"
mkdir -p "$rstarInstallUnzipFileDir"
checksum='589f6b251424e01dcd912e6a059d2d98f33fa73aadcd6376c0e1f1109f594b48' checksum='589f6b251424e01dcd912e6a059d2d98f33fa73aadcd6376c0e1f1109f594b48'
# Verify checksum (sha256sum command may vary based on distribution) if [[ -f "$rstarInstallUnzipFile" ]]; then
echo "$checksum $rstarInstallUnzipFile" | sha256sum -c - echo "$checksum $rstarInstallUnzipFile" | sha256sum -c -
else
echo "Rockstar installer not found: $rstarInstallUnzipFile"
return 1
fi
# Extract files from EXE and capture the output
output=$(7z e "$rockstar_file" -o"$rstarInstallUnzipFileDir" -aoa)
# Parse the output to get the ProductVersion 7z e -y "$rstarInstallUnzipFile" -o"$rstarInstallUnzipFileDir" -aoa > /dev/null 2>&1
version=$(echo "$output" | grep 'ProductVersion:' | awk '{print $2}')
ls -l "$rstarInstallUnzipFileDir" version=$(7z l "$rstarInstallUnzipFile" | awk '/ProductVersion:/ {print $2; exit}')
version="${version:-1.0.0}"
# Create Program Files folders to prepare for copying files
mkdir -p "$rstarInstallDir/Redistributables/VCRed" mkdir -p "$rstarInstallDir/Redistributables/VCRed"
mkdir -p "$rstarInstallDir/ThirdParty/Steam" mkdir -p "$rstarInstallDir/ThirdParty/Steam"
mkdir -p "$rstarInstallDir/ThirdParty/Epic" mkdir -p "$rstarInstallDir/ThirdParty/Epic"
cp "$rstarInstallUnzipFileDir/449" "$rstarInstallDir/Redistributables/VCRed/vc_redist.x64.exe" cp -f "$rstarInstallUnzipFileDir/449" "$rstarInstallDir/Redistributables/VCRed/vc_redist.x64.exe"
cp "$rstarInstallUnzipFileDir/450" "$rstarInstallDir/Redistributables/VCRed/vc_redist.x86.exe" cp -f "$rstarInstallUnzipFileDir/450" "$rstarInstallDir/Redistributables/VCRed/vc_redist.x86.exe"
cp "$rstarInstallUnzipFileDir/451" "$rstarInstallDir/ThirdParty/Steam/steam_api64.dll" cp -f "$rstarInstallUnzipFileDir/451" "$rstarInstallDir/ThirdParty/Steam/steam_api64.dll"
while IFS=' ' read -r number dll; do map_file="$download_dir/Rockstar/211"
dll=${dll//\//\\}
filename=$(basename "$dll" | tr -d '\r')
if [[ $dll == Redistributables\\* ]] || [[ $dll == ThirdParty\\Steam\\* ]] || [[ $number == 474 ]] || [[ $number == 475 ]]; then if [[ -f "$map_file" ]]; then
continue while IFS=' ' read -r number dll || [[ -n "$number" ]]; do
elif [[ $dll == ThirdParty\\Epic\\* ]]; then dll=${dll//\//\\}
cp "$rstarInstallUnzipFileDir/$number" "$epicInstallDir/$filename" filename=$(basename "$dll" | tr -d '\r')
if [[ $dll == Redistributables\\* ]] || \
[[ $dll == ThirdParty\\Steam\\* ]] || \
[[ $number == 474 ]] || \
[[ $number == 475 ]]; then
continue
elif [[ $dll == ThirdParty\\Epic\\* ]]; then
cp -f "$rstarInstallUnzipFileDir/$number" "$epicInstallDir/$filename"
else
cp -f "$rstarInstallUnzipFileDir/$number" "$rstarInstallDir/$filename"
fi
done < "$map_file"
else else
cp "$rstarInstallUnzipFileDir/$number" "$rstarInstallDir/$filename" echo "Mapping file missing: $map_file"
return 1
fi fi
done < "$download_dir/Rockstar/211"
cp "$rstarInstallUnzipFileDir/474" "$rstarInstallDir/ThirdParty/Epic/EOSSDK-Win64-Shipping.dll" cp -f "$rstarInstallUnzipFileDir/474" "$rstarInstallDir/ThirdParty/Epic/EOSSDK-Win64-Shipping.dll"
cp "$rstarInstallUnzipFileDir/475" "$rstarInstallDir/ThirdParty/Epic/EOSSDK-Win64-Shipping-1.14.2.dll" cp -f "$rstarInstallUnzipFileDir/475" "$rstarInstallDir/ThirdParty/Epic/EOSSDK-Win64-Shipping-1.14.2.dll"
# Use a loop for chmod commands
for file in Launcher.exe LauncherPatcher.exe offline.pak RockstarService.exe RockstarSteamHelper.exe uninstall.exe; do for file in Launcher.exe LauncherPatcher.exe offline.pak RockstarService.exe RockstarSteamHelper.exe uninstall.exe; do
chmod +x "$rstarInstallDir/$file" chmod +x "$rstarInstallDir/$file" 2>/dev/null || true
done done
size_kb=$(du -sk "$rstarInstallDir" | cut -f1) size_kb=$(du -sk "$rstarInstallDir" | cut -f1)
size_hex=$(printf '%08x\n' $size_kb) size_hex=$(printf '%08x\n' "$size_kb")
wine_registry_path="HKEY_LOCAL_MACHINE\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Rockstar Games Launcher" wine_registry_path="HKEY_LOCAL_MACHINE\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Rockstar Games Launcher"
# Use a loop for registry commands
declare -A registry_keys=( declare -A registry_keys=(
["DisplayName"]="Rockstar Games Launcher" ["DisplayName"]="Rockstar Games Launcher"
["DisplayIcon"]="C:\\Program Files\\Rockstar Games\\Launcher\\Launcher.exe, 0" ["DisplayIcon"]="C:\\Program Files\\Rockstar Games\\Launcher\\Launcher.exe, 0"
["DisplayVersion"]="$version" ["DisplayVersion"]="$version"
["Publisher"]="Rockstar Games" ["Publisher"]="Rockstar Games"
["InstallLocation"]="C:\\Program Files\\Rockstar Games\\Launcher" ["InstallLocation"]="C:\\Program Files\\Rockstar Games\\Launcher"
["EstimatedSize"]="0x$size_hex" ["EstimatedSize"]="0x$size_hex"
["UninstallString"]="C:\\Program Files\\Rockstar Games\\Launcher\\uninstall.exe" ["UninstallString"]="C:\\Program Files\\Rockstar Games\\Launcher\\uninstall.exe"
["QuietUninstallString"]="\"C:\\Program Files\\Rockstar Games\\Launcher\\uninstall.exe\" /S" ["QuietUninstallString"]="\"C:\\Program Files\\Rockstar Games\\Launcher\\uninstall.exe\" /S"
["HelpLink"]="https://www.rockstargames.com/support" ["HelpLink"]="https://www.rockstargames.com/support"
["URLInfoAbout"]="https://www.rockstargames.com/support" ["URLInfoAbout"]="https://www.rockstargames.com/support"
["URLUpdateInfo"]="https://www.rockstargames.com" ["URLUpdateInfo"]="https://www.rockstargames.com"
["NoModify"]="0x1" ["NoModify"]="0x1"
["NoRepair"]="0x1" ["NoRepair"]="0x1"
["Comments"]="Rockstar Games Launcher" ["Comments"]="Rockstar Games Launcher"
["Readme"]="https://www.rockstargames.com/support" ["Readme"]="https://www.rockstargames.com/support"
) )
for key in "${!registry_keys[@]}"; do for key in "${!registry_keys[@]}"; do
"$STEAM_RUNTIME" "$proton_dir/proton" run reg add "$wine_registry_path" /v "$key" /t REG_SZ /d "${registry_keys[$key]}" /f "$STEAM_RUNTIME" "$proton_dir/proton" run reg add "$wine_registry_path" \
/v "$key" /t REG_SZ /d "${registry_keys[$key]}" /f > /dev/null 2>&1
done done
"$STEAM_RUNTIME" "$proton_dir/proton" run "$rstarInstallDir/Redistributables/VCRed/vc_redist.x64.exe" /install /quiet /norestart "$STEAM_RUNTIME" "$proton_dir/proton" run \
"$STEAM_RUNTIME" "$proton_dir/proton" run "$rstarInstallDir/Redistributables/VCRed/vc_redist.x86.exe" /install /quiet /norestart "$rstarInstallDir/Redistributables/VCRed/vc_redist.x64.exe" \
/install /quiet /norestart > /dev/null 2>&1
"$STEAM_RUNTIME" "$proton_dir/proton" run \
"$rstarInstallDir/Redistributables/VCRed/vc_redist.x86.exe" \
/install /quiet /norestart > /dev/null 2>&1
"$STEAM_RUNTIME" "$proton_dir/proton" run wineserver -w > /dev/null 2>&1
"$STEAM_RUNTIME" "$proton_dir/proton" run wineserver -k > /dev/null 2>&1
return 0
} }
# VK Play specific installation steps # VK Play specific installation steps
@@ -3096,7 +3120,7 @@ function install_launcher {
fi fi
wait 2>/dev/null wait
fi fi
} }
# Install Epic Games Launcher # Install Epic Games Launcher