Skip to content

Instantly share code, notes, and snippets.

@dangreene0
Last active July 24, 2023 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangreene0/a246b5561c5d16bce5b3cd55c21a28a1 to your computer and use it in GitHub Desktop.
Save dangreene0/a246b5561c5d16bce5b3cd55c21a28a1 to your computer and use it in GitHub Desktop.
PF2 on Windows Server 2016 (No Desktop Environment)

Windows Server 2016 Core

Install the OS

Make sure to select without a Desktop Environment! - Don't fear the command line!

Set admin password

Make sure the password has a capitol letter and number

Install prerequisites

You will need to open powershell to get this working.

# This will open powershell! Highly necessary!
powershell 
# This will run powershell as admin! Necessary to download things!
Start-Process powershell -Verb RunAs

cd C:/Users/Administrator/Documents
mkdir servers
cd servers

# Module Prequisites
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # This allows us to download modules
Import-Module bitstransfer
Install-Module -Name 7Zip4Powershell -RequiredVersion 2.0.0 -force

# .Net 4.8 prequisites - needed to use 7Zip
start-bitstransfer -source http://download.windowsupdate.com/c/msdownload/update/software/ftpk/2020/01/windows10.0-kb4486129-x64_0b61d9a03db731562e0a0b49383342a4d8cbe36a.msu -destination .
# Run the program
./windows10.0-kb4486129-x64_0b61d9a03db731562e0a0b49383342a4d8cbe36a.msu
# Finish the installation by restarting your machine

powershell
cd C:/Users/Administrator/Documents/servers

# Import 7Zip to be able to use it
Import-Module 7Zip4Powershell

# Download steamcmd
start-bitstransfer -source https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -destination .
Expand-7Zip -ArchiveFileName steamcmd.zip -TargetPath .

If you get an output then you follow steps correctly!

Congrats prequisites have been installed!

Install SDK2013 and PF2

Open Notepad

notepad

Put the following information in a file.

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ./sdk
app_update 244310
quit

Save as fullupdate.txt

Run steamcmd

./steamcmd.exe +runscript fullupdate.txt

Once it fully installs go into the sdk directory and download PF2

cd sdk

# PF2 is split in twain, sorry blame GitHub for limiting file sizes!
start-bitstransfer -source https://github.com/Pre-Fortress-2/pf2/releases/download/0.7.1/pf2_full_0.7.1.7z.001 -destination .
start-bitstransfer -source https://github.com/Pre-Fortress-2/pf2/releases/download/0.7.1/pf2_full_0.7.1.7z.002 -destination .
# Extract just 001, 7zip will do the rest!
Expand-7Zip -ArchiveFileName pf2_full_0.7.1.7z.001 -TargetPath .

Finally, open notepad and create your server start script

notepad

Enter the following info.

@echo off
srcds.exe -console -game pf2 +maxplayers 24 +map ctf_2fort

Save it as run-server.bat in the sdk folder next to the pf2 folder.

Run the file when you're ready to start up the server!

./run-server.bat

Congrats your server is now running!!

Windows Server 2012 R2 Core

Install the OS

Make sure to select without a Desktop Environment - Don't fear the command line!

Set admin password

Make sure the password has a capitol letter and number

Install prerequisites

You will need to open powershell to get this working.

# This will open powershell! Highly necessary!
powershell 

cd C:/Users/Administrator/Documents
mkdir servers
cd servers

# This will run powershell as admin! Necessary to download things!
Start-Process powershell -Verb RunAs

# Before you can install modules you need to update powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # This allows us to download modules
Invoke-WebRequest "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" -OutFile "C:/Windows/Temp/Win8.1AndW2K12R2-KB3191564-x64.msu"
# Run the file
C:/Windows/Temp/Win8.1AndW2K12R2-KB3191564-x64.msu
# Install it and then restart the server

# Module Prequisites
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # You have to run it a second time
Import-Module bitstransfer
Install-Module -Name 7Zip4Powershell -RequiredVersion 2.0.0 -force

# .Net 4.8 prequisites - needed to use 7Zip
start-bitstransfer -source https://catalog.s.download.windowsupdate.com/d/msdownload/update/software/ftpk/2019/12/windows8.1-kb4486105-x64_1cba02a8aec5034da82cb2dca744648bc4a4eaef.msu -destination .
# Run the program
./windows8.1-kb4486105-x64_1cba02a8aec5034da82cb2dca744648bc4a4eaef.msu
# Finish the installation by restarting your machine

powershell
cd C:/Users/Administrator/Documents/servers

# Import 7Zip to be able to use it
Import-Module 7Zip4Powershell

# Download steamcmd
start-bitstransfer -source https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -destination .
Expand-7Zip -ArchiveFileName steamcmd.zip -TargetPath .

If you get an output then you follow steps correctly!

Congrats prequisites have been installed!

Install SDK2013 and PF2

Open Notepad

notepad

Put the following information in a file.

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ./sdk
app_update 244310
quit

Save as fullupdate.txt

Run steamcmd

./steamcmd.exe +runscript fullupdate.txt

Once it fully installs go into the sdk directory and download PF2

cd sdk

# PF2 is split in twain, sorry blame GitHub for limiting file sizes!
start-bitstransfer -source https://github.com/Pre-Fortress-2/pf2/releases/download/0.7.1/pf2_full_0.7.1.7z.001 -destination .
start-bitstransfer -source https://github.com/Pre-Fortress-2/pf2/releases/download/0.7.1/pf2_full_0.7.1.7z.002 -destination .
# Extract just 001, 7zip will do the rest!
Expand-7Zip -ArchiveFileName pf2_full_0.7.1.7z.001 -TargetPath .

Finally, open notepad and create your server start script

notepad

Enter the following info.

@echo off
srcds.exe -console -game pf2 +maxplayers 24 +map ctf_2fort

Save it as run-server.bat in the sdk folder next to the pf2 folder.

Run the file when you're ready to start up the server!

./run-server.bat

Congrats your server is now running!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment