From bff4dc7f313d6a62c89a43fc7900c3c226f16913 Mon Sep 17 00:00:00 2001 From: HypoxiE Date: Tue, 12 Aug 2025 22:42:09 +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=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= =?UTF-8?q?,=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- install_scenario.ps1 | 4 ++-- paths_checker.ps1 | 23 +++++++++++++++++++++++ setup.bat | 17 +++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 paths_checker.ps1 diff --git a/.gitignore b/.gitignore index e96fab7..4036ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -secrets.ps1 \ No newline at end of file +secrets.ps1 +archive/ +get_archive.bat \ No newline at end of file diff --git a/install_scenario.ps1 b/install_scenario.ps1 index 607d1b5..a4fd24e 100644 --- a/install_scenario.ps1 +++ b/install_scenario.ps1 @@ -2,11 +2,11 @@ $fileId = "1eEBGmfh7Gu2g_KQoCiVg8XsRM9m_-DZB" $baseUrl = "https://drive.google.com/uc?export=download&id=$fileId" $rimworldPath = Join-Path $env:USERPROFILE "AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios" -$rimworldConfigPath = Join-Path $rimworldPath "Scenarios\RuinShip.rsc" +$rimworldScenarioPath = Join-Path $rimworldPath "Scenarios\RuinShip.rsc" $response = Invoke-WebRequest -Uri $baseUrl -SessionVariable session Write-Host "[INFO] Downloading scenario..." -Invoke-WebRequest -Uri $baseUrl -OutFile $rimworldConfigPath +Invoke-WebRequest -Uri $baseUrl -OutFile $rimworldScenarioPath Write-Host "[INFO] RuinShip.rsc was successfully downloaded." -ForegroundColor Green \ No newline at end of file diff --git a/paths_checker.ps1 b/paths_checker.ps1 new file mode 100644 index 0000000..6506147 --- /dev/null +++ b/paths_checker.ps1 @@ -0,0 +1,23 @@ +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$rimworldMods = Resolve-Path (Join-Path $scriptDir "..") + +$rimworldPath = Join-Path $env:USERPROFILE "AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios" +$rimworldScenarioPath = Join-Path $rimworldPath "Scenarios" +$rimworldConfigPath = Join-Path $rimworldPath "Config" + +Write-Host "[INFO] Checking game dirs..." +if (-not(Test-Path $rimworldPath)) { + exit 1 +} + +Write-Host "[INFO] Checking scenario dir..." +if (-not(Test-Path $rimworldScenarioPath)) { + exit 2 +} + +Write-Host "[INFO] Checking config dir..." +if (-not(Test-Path $rimworldConfigPath)) { + exit 3 +} + +exit 0 \ No newline at end of file diff --git a/setup.bat b/setup.bat index 785d7cf..c0dc8c2 100644 --- a/setup.bat +++ b/setup.bat @@ -2,6 +2,23 @@ setlocal enabledelayedexpansion chcp 65001 +powershell -ExecutionPolicy Bypass -File "%~dp0paths_checker.ps1" +if %ERRORLEVEL%==1 ( + echo Ошибка: директория "%%userprofile%%\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios" не найдена + pause + goto end +) +if %ERRORLEVEL%==2 ( + echo Ошибка: директория "%%userprofile%%\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Scenarios" не найдена + pause + goto end +) +if %ERRORLEVEL%==3 ( + echo Ошибка: директория "%%userprofile%%\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config" не найдена + pause + goto end +) + if "%1"=="-mode" ( if "%2"=="" ( echo Ошибка: Аргумент не передан