Compare commits
3 Commits
483ed1d7f1
...
7f30696f02
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f30696f02 | |||
| bef771a3a3 | |||
| fda50e33ce |
@@ -0,0 +1,74 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$apiUrl = 'https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest'
|
||||
$release = Invoke-RestMethod -Uri $apiUrl -Headers @{ 'User-Agent' = 'PowerShell' }
|
||||
$scDownloadUrl = $release.assets[0].browser_download_url
|
||||
|
||||
function Get-EldenRingGameDir {
|
||||
$steamPaths = @(
|
||||
"$env:ProgramFiles(x86)\Steam\steamapps\common\Elden Ring\Game",
|
||||
"$env:ProgramFiles\Steam\steamapps\common\Elden Ring\Game",
|
||||
"$env:LOCALAPPDATA\Programs\Steam\steamapps\common\Elden Ring\Game"
|
||||
)
|
||||
|
||||
foreach ($path in $steamPaths) {
|
||||
if (Test-Path (Join-Path $path 'eldenring.exe')) { return $path }
|
||||
}
|
||||
|
||||
$drives = Get-PSDrive -PSProvider FileSystem | Select-Object -ExpandProperty Root
|
||||
foreach ($drive in $drives) {
|
||||
$hit = Get-ChildItem -Path $drive -Filter 'eldenring.exe' -Recurse -File -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.FullName -match '\\Elden Ring\\Game\\eldenring\.exe$' } |
|
||||
Select-Object -First 1
|
||||
if ($hit) { return $hit.DirectoryName }
|
||||
}
|
||||
|
||||
return $null
|
||||
}
|
||||
|
||||
$eldenringDir = Get-EldenRingGameDir
|
||||
|
||||
if (-not $eldenringDir) {
|
||||
$eldenringDir = Read-Host "Could not auto-detect your Elden Ring Game folder. Enter the full Game folder path"
|
||||
if (-not (Test-Path (Join-Path $eldenringDir 'eldenring.exe'))) {
|
||||
throw "Incorrect Elden Ring directory. 'eldenring.exe' not found at provided path."
|
||||
}
|
||||
} else {
|
||||
$input = Read-Host "Is this your Elden Ring Game folder? $eldenringDir [Y/n]"
|
||||
if ($input -match '^(n|no)$') {
|
||||
$eldenringDir = Read-Host "Please provide your Elden Ring Game folder path"
|
||||
if (-not (Test-Path (Join-Path $eldenringDir 'eldenring.exe'))) {
|
||||
throw "Incorrect Elden Ring directory. 'eldenring.exe' not found at provided path."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tempDir = Join-Path $PWD 'ersc-download'
|
||||
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
|
||||
|
||||
Write-Host "Downloading Seamless Coop"
|
||||
Write-Host "Download URL: $scDownloadUrl"
|
||||
$zipPath = Join-Path $tempDir 'ersc.zip'
|
||||
Invoke-WebRequest -Uri $scDownloadUrl -OutFile $zipPath
|
||||
|
||||
Write-Host "Extracting downloaded files"
|
||||
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force
|
||||
|
||||
$seamlessDir = Join-Path $tempDir 'SeamlessCoop'
|
||||
$launcherPath = Join-Path $eldenringDir 'ersc_launcher.exe'
|
||||
|
||||
if (Test-Path $launcherPath) {
|
||||
$input = Read-Host "Override existing Seamless Coop settings? This resets your Seamless Coop settings, including multiplayer password [Y/n]"
|
||||
if ($input -match '^(n|no)$') {
|
||||
$settings = Join-Path $seamlessDir 'ersc_settings.ini'
|
||||
if (Test-Path $settings) { Remove-Item $settings -Force }
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Copying files to Elden Ring Game folder"
|
||||
Copy-Item -Path (Join-Path $tempDir '*') -Destination $eldenringDir -Recurse -Force
|
||||
|
||||
Write-Host "Cleaning up"
|
||||
Remove-Item $tempDir -Recurse -Force
|
||||
|
||||
Write-Host "Done. Launch ersc_launcher.exe from the Game folder."
|
||||
+20
-8
@@ -1,8 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
#gets latest download url from github
|
||||
sc_download_url=$(curl -s "https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest" | jq -r '.assets[0].browser_download_url')
|
||||
|
||||
if [[ -z "$sc_download_url" || "$sc_download_url" == "null" ]]; then
|
||||
echo "Failed to retrieve download URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#find elden ring install path
|
||||
eldenring_dir=$(find / -path '*/Game/*' -iname eldenring.exe -printf '%h\n' -quit 2>/dev/null)
|
||||
|
||||
@@ -13,7 +19,7 @@ if [[ $input == "n" || $input == "N" || $input == "No" || $input == "no" ]]; the
|
||||
if test -f "$input/eldenring.exe"; then
|
||||
echo "Correct Elden Ring directory"
|
||||
eldenring_dir=$input
|
||||
echo $eldenring_dir
|
||||
echo "$eldenring_dir"
|
||||
else
|
||||
echo "Incorrect Elden Ring directory. 'eldenring.exe' not found at provided path. Exiting..."
|
||||
exit 1
|
||||
@@ -23,16 +29,16 @@ fi
|
||||
input=""
|
||||
|
||||
echo "Creating temp download folder"
|
||||
mkdir -p ./ersc-download
|
||||
cd ./ersc-download
|
||||
temp_dir=$(mktemp -d)
|
||||
cd "$temp_dir"
|
||||
|
||||
echo "Downloading Seamless Coop"
|
||||
echo "Download Url: $sc_download_url"
|
||||
wget -q $sc_download_url
|
||||
wget -q -O seamlesscoop.zip "$sc_download_url"
|
||||
|
||||
echo "Unzipping downloaded files"
|
||||
unzip -q Seamless*
|
||||
rm Seamless*.zip
|
||||
unzip -q seamlesscoop.zip
|
||||
rm seamlesscoop.zip
|
||||
|
||||
# If seamless coop settings exist in install directory, ask the user whether they want to replace the settings file
|
||||
# If 'no', will delete the empty settings file, so it doesn't get overwritten when copying the files
|
||||
@@ -47,5 +53,11 @@ echo "Moving source files to Elden Ring Directory"
|
||||
rsync -r --remove-source-files * "$eldenring_dir"
|
||||
|
||||
echo "Deleting temp download folder"
|
||||
cd ../
|
||||
rm -r ./ersc-download
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$temp_dir"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Done"
|
||||
|
||||
Reference in New Issue
Block a user