Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :main
- cls
- echo +-----------------------------------------------------------------------------+
- echo ^| ^|
- echo ^| SDL 2 Installer for Teeworlds 0.7 Trunk ^|
- echo ^| ^|
- echo +-----------------------------------------------------------------------------+
- echo +-----------------------------------------------------------------------------+
- echo ^| ^|
- echo ^| ^|
- echo ^| Options Available: ^|
- echo ^| ^|
- echo ^| d - Downloads the SDL. This is also the default option if Enter is Pressed. ^|
- echo ^| i - Installs the SDL, if you already downloaded one. ^|
- echo ^| c - Complete installation of SDL. (Download AND install) ^|
- echo ^| r - Removes all temporary file and folder. ^|
- echo ^| ra - Removes all created files, including the downloaded SDL. ^|
- echo ^| a - Shows you all informations about this script. ^|
- echo ^| e - Exits the command prompt. ^|
- echo ^| ^|
- echo +-----------------------------------------------------------------------------+
- echo +-----------------------------------------------------------------------------+
- echo ^| ^|
- echo ^| Please enter your choice. ^|
- echo ^| ^|
- set /p choice=+-----------------------------------------------------------------------------+
- if /I "%choice%"=="d" (goto :download)
- if /I "%choice%"=="i" (goto :install)
- if /I "%choice%"=="c" (goto :complete)
- if /I "%choice%"=="r" (goto :remove)
- if /I "%choice%"=="ra" (goto :remall)
- if /I "%choice%"=="a" (goto :info)
- if /I "%choice%"=="e" (goto :exit)
- :download
- if exist "%cd%\tempdl" (
- if exist "%cd%\tempdl\SDL2.zip" (
- cls
- echo File already Downloaded!
- timeout 3 >nul
- cls
- goto :main
- ) else (
- cls
- bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
- cls
- bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
- cls
- echo Download complete!
- echo Press any key to continue.
- timeout 3 >nul
- cls
- goto :main
- )
- )
- else (
- if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
- goto :download
- )
- :install
- cls
- if exist "%cd%\tempdl\SDL2.zip" (
- if exist "%cd%\other\SDL\alsa" (
- echo SDL already installed!
- timeout 3 >nul
- cls
- goto :main
- )
- else (
- if exist "7z.exe" (
- echo Extracting zip files, please wait...
- "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
- rmdir /S /Q "%cd%\tempdl"
- del /Q "%cd%\7z.exe"
- echo Done.
- echo Press any key to continue.
- timeout 3 >nul
- cls
- goto :main
- )
- else (
- cls
- bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
- cls
- echo Extracting zip files, please wait...
- "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
- rmdir /S /Q "%cd%\tempdl"
- del /Q "%cd%\7z.exe"
- echo Done.
- echo Press any key to continue.
- timeout 3 >nul
- cls
- goto :main
- )
- )
- )
- else (
- cls
- echo No file found!
- timeout 3 >nul
- cls
- goto :main
- )
- :complete
- if exist "%cd%\tempdl" (
- if exist "%cd%\tempdl\SDL2.zip" (
- cls
- goto :install
- )
- else (
- cls
- bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
- bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
- cls
- echo Download complete!
- echo Press any key to continue.
- timeout 3 >nul
- cls
- goto :install
- )
- )
- else (
- if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
- bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
- bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
- cls
- echo Download complete!
- timeout 3 >nul
- cls
- echo Extracting zip files, please wait...
- "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
- rmdir /S /Q "%cd%\tempdl"
- del /Q "%cd%\7z.exe"
- echo Done.
- echo Press any key to continue.
- timeout 3 >nul
- cls
- goto :main
- )
- :remove
- cls
- if exist "%cd%\tempdl" (
- echo Removing files...
- rmdir /S /Q "%cd%\tempdl"
- del /Q "%cd%\7z.exe"
- echo All files successfully removed. Press any key to continue.
- timeout 3 >nul
- cls
- goto :main
- ) else (
- echo No files to remove found!
- timeout 3 >nul
- cls
- goto :main
- )
- :remall
- cls
- if exist "%cd%\other\SDL\alsa" (
- echo Securing default files...
- xcopy "%cd%\other\SDL\VERSION" "%cd%\tempdl" /I /C /Y /Z
- xcopy "%cd%\other\SDL\sdl.lua" "%cd%\tempdl" /I /C /Y /Z
- echo Removing all SDL files...
- rmdir /S /Q "%cd%\other\SDL"
- echo Recreating default files...
- mkdir "%cd%\other\SDL"
- xcopy "%cd%\tempdl\VERSION" "%cd%\other\SDL" /I /C /Y /Z
- xcopy "%cd%\tempdl\sdl.lua" "%cd%\other\SDL" /I /C /Y /Z
- rmdir /S /Q "%cd%\tempdl"
- del /Q "%cd%\7z.exe"
- echo All temporary files were successfully removed. Continuing with SDL.
- timeout 3 >nul
- cls
- goto :main
- )
- if not exist "%cd%\tempdl" (
- echo No files to remove found!
- timeout 3 >nul
- cls
- goto :main
- )
- :info
- cls
- echo +----------------------------------------------------------------+------------+
- echo ^| ^| ^|
- echo ^| SDL 2 Installer for Teeworlds 0.7 Trunk ^| v0.2 ^|
- echo ^| ^| ^|
- echo +----------------------------------------------------------------+------------+
- echo +-----------------------------------------------------------------------------+
- echo ^| ^|
- echo ^| SDL 2 Installer for Teeworlds 0.7 Trunk was made by Blade, for all ^|
- echo ^| modders out there, who are sick of doing it manualy thereself each and ^|
- echo ^| every time. ^|
- echo ^| ^|
- echo ^| This script uses basic Batch commands, as well as the 7-Zip File Manager ^|
- echo ^| and LibSDL. ^|
- echo ^| ^|
- echo ^| Links : www.7-zip.org www.libsdl.org ^|
- echo ^| ^|
- echo ^| This tool is free to use as well as to share, but please give credit. ^|
- echo ^| ^|
- echo +-----------------------------------------------------------------------------+
- echo +-----------------------------------------------------------------------------+
- echo ^| ^|
- echo ^| Press any key to continue. ^|
- echo ^| ^|
- echo +-----------------------------------------------------------------------------+
- timeout 30 >nul
- goto :main
- :exit
- cls
- echo Goodbye!
- timeout 3 >nul
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement