From 5aa8aaf3635f2af01968663395af4e4887d1274f Mon Sep 17 00:00:00 2001 From: HypoxiE Date: Tue, 12 Aug 2025 01:19:52 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=83=D1=89=D0=B5=D1=81=D1=82=D0=B2=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B8=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=B8=D0=B9=20=D0=B8=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + download_mods.ps1 | 23 +++++++++++++++++++---- setup.bat | 4 ++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..e96fab7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +secrets.ps1 \ No newline at end of file diff --git a/download_mods.ps1 b/download_mods.ps1 index 9bf6355..8401cb0 100644 --- a/download_mods.ps1 +++ b/download_mods.ps1 @@ -2,6 +2,24 @@ $fileId = "13im-l6X2j-s5scZZlBvt2DCjYBbk2qI8" $baseUrl = "https://drive.google.com/uc?export=download&id=$fileId" $outputFile = "$env:TEMP\ruinship_mods.rar" +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$rimworldMods = Resolve-Path (Join-Path $scriptDir "..") + +if (-not($rimworldMods -like "*Mods")) { + Write-Host "[Error] Place this program in the Mods folder of the RimWorld game" -ForegroundColor Red + Pause + exit +} + +$ruinship_mod = Join-Path $rimworldMods "\ruinship_mods.rar" + +if (Test-Path $rimworldMods) { + Write-Host "[WARNING] The archive ruinship_mods.rar already exists" -ForegroundColor Yellow + Write-Host "[INFO] Deleting the archive..." + Remove-Item -Recurse -Force $ruinship_mod +} + +Write-Host "[INFO] Sending a request to google disk..." $response = Invoke-WebRequest -Uri $baseUrl -SessionVariable session $form = $response.Forms | Where-Object { $_.Id -eq "download-form" } @@ -27,13 +45,10 @@ else { Write-Host "[INFO] The file was successfully downloaded directly." } -$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition -$rimworldMods = Resolve-Path (Join-Path $scriptDir "..") - $sourceFolder = Get-ChildItem $outputFile | Select-Object -First 1 Copy-Item -Path $sourceFolder.FullName -Destination $rimworldMods Write-Host "[INFO] Cleaning up..." Remove-Item $outputFile -Write-Host "[INFO] The ruinship_mods.rar file has been installed to the path $rimworldMods. Please extract it to install all the necessary mods." -ForegroundColor Green +Write-Host "The ruinship_mods.rar file has been installed to the path $rimworldMods. Please extract it to install all the necessary mods." -ForegroundColor Green diff --git a/setup.bat b/setup.bat index f14feef..9f3d145 100644 --- a/setup.bat +++ b/setup.bat @@ -19,6 +19,10 @@ if "%1"=="-mode" ( call :ScenarioInstall goto end ) + if "%2"=="all" ( + call :installAll + goto end + ) echo Ошибка: Режима %2 не существует goto end )