Добавлены проверки, изменены некоторые имена
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
secrets.ps1
|
||||
secrets.ps1
|
||||
archive/
|
||||
get_archive.bat
|
||||
@@ -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
|
||||
23
paths_checker.ps1
Normal file
23
paths_checker.ps1
Normal 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
|
||||
17
setup.bat
17
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 Ошибка: Аргумент не передан
|
||||
|
||||
Reference in New Issue
Block a user