Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title Rust Server installer - by BatchER
- cls
- @echo off
- rem Set Vaiables
- echo --------------------------------------------------------------------
- echo Change, if desired, your instlling directory.
- :directory_change1
- set /p directory_change=Do you want to change your installing directory from default C:\RustServer\ [y]es / [n]o
- if "%directory_change%" == "y" (
- echo The path should look like this: C:\Folder1\Folder2\Folder3\
- set /p directory=Enter directoy path:
- goto directory_change3
- ) else (
- goto directory_change2
- )
- :directory_change2
- if "%directory_change%" == "n" (
- set directory=C:\RustServer\
- goto directory_change3
- ) else (
- cls
- echo Error - invalid answer
- goto directory_change1
- )
- :directory_change3
- cls
- echo --------------------------------------------------------------------
- :mods1
- echo Oxide is a programm to install mods in your Rust server. For more information visit: http://oxidemod.org/
- set /p mods=Do you want to install Oxide [y]es / [n]o?
- if "%mods%" == "y" (
- set install_oxide=y
- goto mods3
- ) else (
- goto mods2
- )
- :mods2
- if "%mods%" == "n" (
- set install_oxide=n
- goto mods3
- ) else (
- cls
- echo Error - invalid answer
- goto mods1
- )
- :mods3
- cls
- echo --------------------------------------------------------------------
- :port_change1
- set /p port_change=Do you want to change your server port from default 28015 [y]es / [n]o
- if "%port_change%" == "y" (
- set /p port=Enter the new port:
- goto port_change3
- ) else (
- goto port_change2
- )
- :port_change2
- if "%port_change%" == "n" (
- set port=28015
- goto port_change3
- ) else (
- cls
- echo Error - invalid answer
- goto port_change1
- )
- :port_change3
- cls
- echo --------------------------------------------------------------------
- echo Be sure to check out the "help" directory in your server, to get detailled instructions about connecting and playing with friends
- echo Press any key to continue
- pause
- rem Set IP Variable
- for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b
- set ip=%ip:~1%
- rem create directorys
- if exist %directory% (
- goto directory_after
- ) else (
- md %directory%
- )
- :directory_after
- md %directory%SteamCMD
- md %directory%RustServer
- md %directory%RustServer\help
- rem Download SteamCMD
- :cmd_not_exist
- cls
- echo --------------------------------------------------------------------
- echo %date% %time% attempt to download SteamCMD
- timeout 2
- bitsadmin /transfer download_SteamCMD /download /priority normal https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip %directory%SteamCMD\steamcmd.zip
- setlocal
- set cmd_file="%directory%SteamCMD\steamcmd.zip"
- set cmd_bytesize=755
- FOR /F "usebackq" %%A IN ('%cmd_file%') DO set size=%%~zA
- if %size% GTR %cmd_bytesize% (
- goto cmd_exist
- ) else (
- del cmd_file
- goto cmd_not_exist
- )
- :cmd_exist
- cls
- echo --------------------------------------------------------------------
- echo %date% %time% SteamCMD successfully downloaded
- timeout 2
- rem Unzip SteamCMD
- :unzip_not_exist
- cls
- echo --------------------------------------------------------------------
- echo %date% %time% attempt to download unzipper
- timeout 2
- bitsadmin /transfer download_unzipper /download /priority high http://stahlworks.com/dev/unzip.exe %directory%SteamCMD\unzip.exe
- setlocal
- set unzip_file="%directory%SteamCMD\unzip.exe"
- set unzip_bytesize=163
- FOR /F "usebackq" %%A IN ('%unzip_file%') DO set size=%%~zA
- if %size% GTR %unzip_bytesize% (
- goto unzip_exist
- ) else (
- del %unzip_file%
- goto unzip_not_exist
- )
- :unzip_exist
- cls
- echo --------------------------------------------------------------------
- echo unzipper successfully downloaded
- timeout 2
- cd %directory%SteamCMD
- unzip steamcmd.zip
- rem Install SteamCMD
- >> %directory%SteamCMD\input.txt echo login anonymous
- >> %directory%SteamCMD\input.txt echo force_install_dir %directory%RustServer\
- >> %directory%SteamCMD\input.txt echo app_update 258550
- >> %directory%SteamCMD\input.txt echo quit
- cls
- %directory%SteamCMD\steamcmd.exe < input.txt
- del %directory%SteamCMD\input.txt
- rem Writing How to Join
- >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\help\HowToJoin.txt echo Open your console in Rust with pressing "F1" and then press strg+v to pass in the command to connect to your server. It will be copied to your clipboard every time you start your server.
- >> %directory%RustServer\help\HowToJoin.txt echo Or type in: client.connect %ip%:%port%
- >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\help\HowToJoin.txt echo There are two ways to play with your friends:
- >> %directory%RustServer\help\HowToJoin.txt echo 1: Download and run LogMeIn Hamachi. For that run "install_LogMeInHamchi.bat" in your folder "help" and follow the instructions to install
- >> %directory%RustServer\help\HowToJoin.txt echo now create a network and let your friends join
- >> %directory%RustServer\help\HowToJoin.txt echo go to the "server.bat" file and change the IP-Adress to your Hamachi IPv4 IP
- >> %directory%RustServer\help\HowToJoin.txt echo now your friends can join by typing in "client.connect -HamchiIP-:%port%"
- >> %directory%RustServer\help\HowToJoin.txt echo 2: Open the port given in your "run.bat" in your router with Port-Forwarding (Video-Tutorial: https://www.youtube.com/playlist?list=PLwpd5nRUaDqE-a48Y2WT4N8cYCLXZuodc)
- >> %directory%RustServer\help\HowToJoin.txt echo now your friends can join by searching for your Server in the official/modded servers, depending on if you have installed Oxide, in Rust
- >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\help\HowToJoin.txt echo NOTICE when you change your Server-IP or your Server-Port run the update.bat
- rem Write connect.txt
- >> %directory%RustServer\connect.txt echo client.connect %ip%:%port%
- rem Write run.bat
- >> %directory%RustServer\run.bat echo clip < connect.txt
- >> %directory%RustServer\run.bat echo RustDedicated.exe -batchmode +server.hostname "MyServer" +server.ip %ip% -server.port %port% +server.maxplayer 2 -logFile server.log +rcon.password "12345" -server.worldsize 4000
- rem Wirte update.bat
- >> %directory%RustServer\update.bat echo for /f "tokens=6" %%a in (run.bat) do set newip=%%a
- >> %directory%RustServer\update.bat echo for /f "tokens=8" %%a in (run.bat) do set newport=%%a
- >> %directory%RustServer\update.bat echo del connect.txt
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\connect.txt client.connect %newip%:%newport%
- >> %directory%RustServer\update.bat echo del %directory%RustServer\help\HowToJoin.txt
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo Open your console in Rust with pressing "F1" and then press strg+v to pass in the command to connect to your server. It will be copied to your clipboard every time you start your server.
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo Or type in: client.connect %newip%:%newport%
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo There are two ways to play with your friends:
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo 1: Download and run LogMeIn Hamachi. For that run "install_LogMeInHamchi.bat" in your folder "help" and follow the instructions to install
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo now create a network and let your friends join
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo go to the "server.bat" file and change the IP-Adress to your Hamachi IPv4 IP
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo now your friends can join by typing in "client.connect -HamchiIP-:%newport%"
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo 2: Open the port given in your "run.bat" in your router with Port-Forwarding (Video-Tutorial: https://www.youtube.com/playlist?list=PLwpd5nRUaDqE-a48Y2WT4N8cYCLXZuodc)
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo now your friends can join by searching for your Server in the official/modded servers, depending on if you have installed Oxide, in Rust
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo --------------------------------------------------------------------
- >> %directory%RustServer\update.bat echo >> %directory%RustServer\help\HowToJoin.txt echo NOTICE when you change your Server-IP or your Server-Port run the update.bat
- rem Write Install LogMeIn Hamachi
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo :hamachi_not_exist
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo cls
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo echo --------------------------------------------------------------------
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo echo %date% %time% attempt to download Hamachi
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo timeout 2
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo bitsadmin /transfer download_LogMeInHamachi /download /priority normal https://secure.logmein.com/hamachi.msi %directory%RustServer\help\hamachi.msi
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo setlocal
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo set hamachi_file="%directory%RustServer\help\hamachi.msi"
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo set hamachi_bytesize=8784
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo FOR /F "usebackq" %%A IN ('%hamachi_file%') DO set size=%%~zA
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo if %size% GTR %hamachi_bytesize% (
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo goto hamachi_exist
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo ) else (
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo del %hamachi_file%
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo goto hamachi_not_exist
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo )
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo :hamachi_exist
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo cls
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo echo --------------------------------------------------------------------
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo echo %date% %time% Hamachi successfully downloaded
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo timeout 2
- >> %directory%RustServer\help\install_LogMeInHamchi.bat echo start %directory%RustServer\help\hamachi.msi
- rem Install Oxide?
- if "%install_oxide%" == "y" (
- goto installing_oxide
- ) else (
- goto end
- )
- :istalling_oxide
- rem Download Oxide
- md %directory%SteamCMD\temp\
- :oxide_not_exist
- cls
- echo --------------------------------------------------------------------
- echo %date% %time% attempt to download Oxide
- timeout 2
- bitsadmin /transfer download_Oxide /download /priority normal https://github.com/OxideMod/Snapshots/raw/master/Oxide-Rust.zip %directory%SteamCMD\temp\Oxide-Rust.zip
- setlocal
- set oxide_file="%directory%SteamCMD\temp\Oxide-Rust.zip"
- set oxide_bytesize=11432
- FOR /F "usebackq" %%A IN ('%oxide_file%') DO set size=%%~zA
- if %size% GTR %oxide_bytesize% (
- goto oxide_exist
- ) else (
- del %oxide_file%
- goto oxide_not_exist
- )
- :oxide_exist
- cls
- echo --------------------------------------------------------------------
- echo Oxide successfully downloaded
- timeout 2
- rem Unzip and install oxide
- move %directory%SteamCMD\unzip.exe %directory%SteamCMD\temp\unzip.exe
- cd %directory%SteamCMD\temp
- unzip Oxide-Rust.zip
- del unzip.exe
- del Oxide-Rust.zip
- move /q %directory%SteamCMD\temp\RustDedicated_Data %directory%RustServer\
- move /q %directory%SteamCMD\temp\_start-example.bat %directory%RustServer\
- move /q %directory%SteamCMD\temp\CSharpCompiler.exe %directory%RustServer\
- move /q %directory%SteamCMD\temp\oxide.root.json %directory%RustServer\
- rem Write about Oxide
- >> %directory%RustServer\help\About_Oxide.txt echo Oxide is a Programm, which allows you to install mods into Rust
- >> %directory%RustServer\help\About_Oxide.txt echo For more information visit: http://oxidemod.org/
- rem Write how to use Oxide
- >> %directory%RustServer\help\How_to_use_Oxide.txt echo Download Mods from the Oxide-Rust forum (http://oxidemod.org/plugins/categories/rust.24/)
- >> %directory%RustServer\help\How_to_use_Oxide.txt echo past them into the directory %directory%RustServer\server\my_server_identity\oxide\plugins
- :end
- rem Run Server
- >> %directory%RustServer\input.txt echo save
- >> %directory%RustServer\input.txt echo quit
- %directory%RustServer\run.bat < input.txt
- cls
- echo --------------------------------------------------------------------
- echo Installation finished!
- echo To quit press any key
- echo Be sure to don't forget to check out the "help" directory, located in your RustServer file
- pause
- del %directory%RustServer\input.txt
Advertisement
Add Comment
Please, Sign In to add comment