-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.bat
66 lines (59 loc) · 2.39 KB
/
Install.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
IF NOT "%1" == "debug" (
ECHO OFF
CLS
)
REM Check if Scrap Mechanic is running
tasklist /FI "IMAGENAME eq ScrapMechanic.exe" 2>NUL | find /I /N "ScrapMechanic.exe">NUL
if "%ERRORLEVEL%"=="0" (
echo Please close Scrap Mechanic before you install sm.interop
pause
GOTO :EOF
)
REM Try Common paths first
SET ScrapMechanicPath=C:\Program Files\Steam\steamapps\common\Scrap Mechanic
IF EXIST "%ScrapMechanicPath%" GOTO :found
SET ScrapMechanicPath=C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic
IF EXIST "%ScrapMechanicPath%" GOTO :found
SET ScrapMechanicPath=D:\Steam\steamapps\common\Scrap Mechanic
IF EXIST "%ScrapMechanicPath%" GOTO :found
SET ScrapMechanicPath=B:\Steam\steamapps\common\Scrap Mechanic
IF EXIST "%ScrapMechanicPath%" GOTO :found
REM Try by finding the Steam installation path
FOR /f "delims=" %%a in ('reg query HKCU\Software\Valve\Steam /v SteamPath') DO SET SteamPath=%%a
SET SteamPath=%SteamPath:~26%
for /f "tokens=* delims= " %%a in ("%SteamPath%") do set SteamPath=%%a
IF NOT EXIST "%SteamPath%" (
FOR /f "delims=" %%a in ('reg query HKCU\Software\WOW6432Node\Valve\Steam /v SteamPath') DO SET SteamPath=%%a
SET SteamPath=%SteamPath:~26%
for /f "tokens=* delims= " %%a in ("%SteamPath%") do set SteamPath=%%a
)
IF NOT EXIST "%SteamPath%" (
FOR /f "delims=" %%a in ('reg query HKLM\SOFTWARE\WOW6432Node\Valve\Steam /v InstallPath') DO SET SteamPath=%%a
SET SteamPath=%SteamPath:~26%
for /f "tokens=* delims= " %%a in ("%SteamPath%") do set SteamPath=%%a
)
IF NOT EXIST "%SteamPath%" (
ECHO Could not find the Steam installation path
GOTO :enter
)
SET SteamPath=%SteamPath:/=\%
SET SteamPath=%SteamPath:"=%
ECHO Found Steam folder at %SteamPath%
SET ScrapMechanicPath=%SteamPath%\steamapps\common\Scrap Mechanic
SET ScrapMechanicPath=%ScrapMechanicPath:"=%
IF EXIST "%ScrapMechanicPath%" goto :found
:enter
ECHO.
ECHO Could not find Scrap Mechanic folder. Please enter the Scrap Mechanic installation folder manually.
ECHO To exit this script, do not enter anything and press enter.
SET /p ScrapMechanicPath="Scrap Mechanic folder: "
SET ScrapMechanicPath=%ScrapMechanicPath:"=%
IF "%ScrapMechanicPath%" == "" goto :EOF
IF NOT EXIST "%ScrapMechanicPath%" goto :enter
:found
ECHO Found Scrap Mechanic folder at: %ScrapMechanicPath%
ECHO Installing sm.interop game files
xcopy "GamefileMod" "%ScrapMechanicPath%" /y /s
ECHO Game files installed!
PAUSE
:EOF