Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit 2dcbe81

Browse files
author
brysondev
committed
v3.0.0 - Windows 7 compatibility
1 parent c5afdf6 commit 2dcbe81

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# OF-Install-Script
22
![](https://openfortress.fun/media/logo.svg)
33

4-
Installs Open Fortress with relative ease. Windows 10+ only (Its possible for the script to work on windows below 10, but make sure powershell is up to date!)
4+
Installs Open Fortress with relative ease. Windows 7+ (SP1 & [Windows Management Framework 3.0](https://www.microsoft.com/en-ca/download/details.aspx?id=34595))
55

66
### Instructions
77

8-
1. Download the prerequisites: - [Steam](https://store.steampowered.com/about/)
8+
1. Download the prerequisites: - [Steam](https://store.steampowered.com/about/) (& for windows 7 users: [Windows Management Framework 3.0](https://www.microsoft.com/en-ca/download/details.aspx?id=34595))
99

1010
2. Allow the script to download and run (Since its a batch script, windows likes to say "oh no its a virus" but you can read the code right [here](https://github.com/brysondev/OF-Install-Script/blob/main/of_install.bat))
1111

of_install.bat

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ echo Also expect this to freeze a bunch for a fresh install!!
1414
echo.
1515
PAUSE
1616

17+
REG QUERY "HKLM\SOFTWARE\Microsoft\PowerShell\3" > nul 2>&1
18+
if %ERRORLEVEL% EQU 1 (
19+
echo Missing Powershell v3. Please install it at the following link: https://www.microsoft.com/en-ca/download/details.aspx?id=34595 and re-run this script.
20+
powershell -Command "start https://www.microsoft.com/en-ca/download/details.aspx?id=34595"
21+
goto exitmain
22+
)
23+
1724
REG QUERY HKCU\SOFTWARE\Valve\Steam\Apps\440 > nul 2>&1
1825
if %ERRORLEVEL% EQU 0 (
1926
REG QUERY HKCU\SOFTWARE\Valve\Steam\Apps\243750 > nul 2>&1
@@ -43,7 +50,9 @@ goto murse
4350

4451
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
4552
:murse
53+
echo.
4654
setlocal ENABLEEXTENSIONS
55+
setlocal ENABLEDELAYEDEXPANSION
4756
set MURSE_PATH=%TEMP%\murse\
4857
set PATH_STEAM=HKEY_CURRENT_USER\SOFTWARE\Valve\Steam
4958
set VALUE_STEAM=SourceModInstallPath
@@ -61,17 +70,18 @@ if not exist %STEAM_REG_PATH%\NUL > nul 2>&1(
6170
)
6271

6372
if exist %MURSE_PATH% (
64-
cd %TEMP%
73+
cd /D %TEMP%
6574
@RD /S /Q %TEMP%\murse
6675
)
6776

6877
if not exist "%MURSE_PATH%murse.exe" (
6978
echo Installing Murse CLI...
7079
echo.
71-
cd %TEMP%
80+
cd /D %TEMP%
7281
md "murse"
73-
cd "murse"
74-
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://git.sr.ht/~welt/murse/refs/download/v0.3.2/murse-v0.3.2-windows-386.zip', 'murse.zip')"
82+
cd /D "murse"
83+
:: For windows 7 backwards compatibility...
84+
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('https://git.sr.ht/~welt/murse/refs/download/v0.3.2/murse-v0.3.2-windows-386.zip', 'murse.zip')"
7585
Call :UnZipFile "%MURSE_PATH%" "%MURSE_PATH%murse.zip"
7686
)
7787
goto verify
@@ -80,7 +90,7 @@ goto verify
8090
:verify
8191
echo Verifying Murse exists...
8292
cd /D "%MURSE_PATH%"
83-
murse.exe -h
93+
murse.exe -h > nul 2>&1
8494

8595
if errorlevel 1 (
8696
echo Murse inaccessable. Verify that murse exists in: %MURSE_PATH%.
@@ -142,14 +152,14 @@ echo Finished!
142152

143153
tasklist /fi "ImageName eq steam.exe" /fo csv 2>NUL | find /I "steam.exe">NUL
144154
if "%ERRORLEVEL%"=="0" (
145-
echo Steam is still running! Restarting it now...
155+
echo Steam is still running. Restarting it now...
146156
taskkill /F /IM steam.exe
147157
)
148158
TIMEOUT /T 3
149159
tasklist /fi "ImageName eq steam.exe" /fo csv 2>NUL | find /I "steam.exe">NUL
150160
if "%ERRORLEVEL%"=="0" (
151161
echo.
152-
echo Steam is still running! We can't kill it for some reason. Exiting...
162+
echo Steam is still running. We can't kill it for some reason. Exiting...
153163
goto exitmain
154164
)
155165

@@ -191,7 +201,7 @@ echo %ESC%[0m %ESC%[0m %ESC%[0m %ESC%[0m %ESC%[0m %ESC%[0m %ESC%[0m %ESC%[0m %ES
191201
echo.
192202
echo Cleaning up...
193203
if exist %MURSE_PATH% (
194-
cd %TEMP%
204+
cd /D %TEMP%
195205
@RD /S /Q %TEMP%\murse
196206
)
197207
goto exitmain

0 commit comments

Comments
 (0)