Добавлены проверки, изменены некоторые имена

This commit is contained in:
2025-08-12 22:42:09 +07:00
parent e28099bbcc
commit bff4dc7f31
4 changed files with 45 additions and 3 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
secrets.ps1 secrets.ps1
archive/
get_archive.bat

View File

@@ -2,11 +2,11 @@ $fileId = "1eEBGmfh7Gu2g_KQoCiVg8XsRM9m_-DZB"
$baseUrl = "https://drive.google.com/uc?export=download&id=$fileId" $baseUrl = "https://drive.google.com/uc?export=download&id=$fileId"
$rimworldPath = Join-Path $env:USERPROFILE "AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios" $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 $response = Invoke-WebRequest -Uri $baseUrl -SessionVariable session
Write-Host "[INFO] Downloading scenario..." 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 Write-Host "[INFO] RuinShip.rsc was successfully downloaded." -ForegroundColor Green

23
paths_checker.ps1 Normal file
View File

@@ -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

View File

@@ -2,6 +2,23 @@
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
chcp 65001 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 "%1"=="-mode" (
if "%2"=="" ( if "%2"=="" (
echo Ошибка: Аргумент не передан echo Ошибка: Аргумент не передан