Skip to content

Commit 1c6f4ff

Browse files
committed
Add error if there are spaces in the directory path
1 parent 28efa61 commit 1c6f4ff

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

App/Installer/install.bat

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ goto :EOF
4545
echo:
4646

4747

48-
set "answer="
49-
for %%a in (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) do (
48+
set "answer="
49+
for %%a in (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) do (
5050
if /i "!answer!" neq "Y" if /i "!answer!" neq "N" (
5151
set /P answer="Do you want to install SimCity from archive.org [Y/N]? " || set answer=xxxx
5252
)
53-
)
54-
echo:
55-
if /i "!answer!" equ "n" exit /b -1
53+
)
54+
echo:
55+
if /i "!answer!" equ "n" exit /b -1
5656

5757

5858
set downloadmethod=webclient
@@ -61,13 +61,14 @@ goto :EOF
6161

6262
set /p downloadurl=<"%~dp0\simcityurl"
6363

64-
:: Try downloading SimCity ten times
65-
for /L %%a in (1,1,1,1,1,1,1,1,1,1) do (
64+
:: Try downloading SimCity ten times
65+
for /L %%a in (1,1,1,1,1,1,1,1,1,1) do (
66+
echo Downloading 180mb .iso file from archive.org... be patient
6667
if not exist "%~dp0\simcity.iso" (
6768
if "%downloadmethod%" equ "webclient" (
68-
powershell -NoP -Command "(New-Object Net.WebClient).DownloadFile(\"%downloadurl%\", '%~dp0\simcity.iso-temp')"
69+
powershell -NoP -Command "(New-Object Net.WebClient).DownloadFile('%downloadurl%', '%~dp0\simcity.iso-temp')"
6970
) else (
70-
powershell -NoP -Command "Invoke-WebRequest \"%downloadurl%\" -OutFile '%~dp0\simcity.iso-temp'"
71+
powershell -NoP -Command "Invoke-WebRequest '%downloadurl%' -OutFile '%~dp0\simcity.iso-temp'"
7172
)
7273
)
7374
if "!errorlevel!" equ "0" (
@@ -77,7 +78,7 @@ goto :EOF
7778
REM wait one seconds
7879
ping 127.0.0.1 -n 2 > nul
7980
)
80-
)
81+
)
8182

8283
"%~dp0\7z.exe" x "%~dp0\simcity.iso" -o"%~dp0\simcity"
8384

App/SimCity_Win10/SimCity_Win10.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
@echo off
22
set __COMPAT_LAYER=WinXP
33

4+
:: Test if directory contains spaces
5+
set "_here=%~dp0"
6+
if "%_here%" neq "%_here: =_%" (
7+
call cmd /c "echo Error: SimCity cannot run if there are spaces in its directory path&echo Move to a different directory and try again&echo.&pause"
8+
goto :eof
9+
)
10+
411
:: Copy SimCity files if not yet copied
512
if not exist "%~dp0..\SC2K\SIMCITY.EXE" call cmd /c "call "%~dp0..\Installer\install.bat" "
613

0 commit comments

Comments
 (0)