Advertisement
Guest User

GetSDL.bat

a guest
May 5th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 8.25 KB | None | 0 0
  1. @echo off
  2. :main
  3. cls
  4. echo +-----------------------------------------------------------------------------+
  5. echo ^|                                                                             ^|
  6. echo ^|                   SDL 2 Installer for Teeworlds 0.7 Trunk                   ^|
  7. echo ^|                                                                             ^|
  8. echo +-----------------------------------------------------------------------------+
  9. echo +-----------------------------------------------------------------------------+
  10. echo ^|                                                                             ^|
  11. echo ^|                                                                             ^|
  12. echo ^|                              Options Available:                             ^|
  13. echo ^|                                                                             ^|
  14. echo ^| d - Downloads the SDL. This is also the default option if Enter is Pressed. ^|
  15. echo ^| i - Installs the SDL, if you already downloaded one.                        ^|
  16. echo ^| c - Complete installation of SDL. (Download AND install)                    ^|
  17. echo ^| r - Removes all temporary file and folder.                                  ^|
  18. echo ^| ra - Removes all created files, including the downloaded SDL.               ^|
  19. echo ^| a - Shows you all informations about this script.                           ^|
  20. echo ^| e - Exits the command prompt.                                               ^|
  21. echo ^|                                                                             ^|
  22. echo +-----------------------------------------------------------------------------+
  23. echo +-----------------------------------------------------------------------------+
  24. echo ^|                                                                             ^|
  25. echo ^|                          Please enter your choice.                          ^|
  26. echo ^|                                                                             ^|
  27. set /p choice=+-----------------------------------------------------------------------------+
  28.  
  29.  
  30.  
  31. if /I "%choice%"=="d" (goto :download)
  32. if /I "%choice%"=="i" (goto :install)
  33. if /I "%choice%"=="c" (goto :complete)
  34. if /I "%choice%"=="r" (goto :remove)
  35. if /I "%choice%"=="ra" (goto :remall)
  36. if /I "%choice%"=="a" (goto :info)
  37. if /I "%choice%"=="e" (goto :exit)
  38.  
  39.  
  40.  
  41. :download
  42. if exist "%cd%\tempdl" (
  43.  
  44.     if exist "%cd%\tempdl\SDL2.zip" (
  45.         cls
  46.         echo File already Downloaded!
  47.         timeout 3 >nul
  48.         cls
  49.         goto :main
  50.     ) else (
  51.         cls
  52.         bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
  53.         cls
  54.         bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
  55.         cls
  56.         echo Download complete!
  57.         echo Press any key to continue.
  58.         timeout 3 >nul
  59.         cls
  60.         goto :main
  61.     )
  62.    
  63. )
  64. else (
  65.     if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
  66.     goto :download
  67. )
  68.  
  69. :install
  70. cls
  71. if exist "%cd%\tempdl\SDL2.zip" (
  72.     if exist "%cd%\other\SDL\alsa" (
  73.         echo SDL already installed!
  74.         timeout 3 >nul
  75.         cls
  76.         goto :main
  77.     )
  78.     else (
  79.         if exist "7z.exe" (
  80.             echo Extracting zip files, please wait...
  81.             "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
  82.             rmdir /S /Q "%cd%\tempdl"
  83.             del /Q "%cd%\7z.exe"
  84.             echo Done.
  85.             echo Press any key to continue.
  86.             timeout 3 >nul
  87.             cls
  88.             goto :main
  89.         )
  90.         else (
  91.             cls
  92.             bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
  93.             cls
  94.             echo Extracting zip files, please wait...
  95.             "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
  96.             rmdir /S /Q "%cd%\tempdl"
  97.             del /Q "%cd%\7z.exe"
  98.             echo Done.
  99.             echo Press any key to continue.
  100.             timeout 3 >nul
  101.             cls
  102.             goto :main
  103.         )
  104.     )
  105. )
  106. else (
  107.     cls
  108.     echo No file found!
  109.     timeout 3 >nul
  110.     cls
  111.     goto :main
  112. )
  113.  
  114. :complete
  115. if exist "%cd%\tempdl" (
  116.     if exist "%cd%\tempdl\SDL2.zip" (
  117.             cls
  118.             goto :install
  119.         )
  120.         else (
  121.             cls
  122.             bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
  123.             bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
  124.             cls
  125.             echo Download complete!
  126.             echo Press any key to continue.
  127.             timeout 3 >nul
  128.             cls
  129.             goto :install
  130.         )
  131. )
  132.  
  133. else (
  134.     if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
  135.     bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.0.zip "%cd%\tempdl\SDL2.zip"
  136.     bitsadmin.exe /transfer "Downloading unzipping tool..." http://download2146.mediafire.com/rn4fzy06z99g/hnldfnechj3ff17/7z.exe "%cd%\7z.exe"
  137.     cls
  138.     echo Download complete!
  139.     timeout 3 >nul
  140.     cls
  141.     echo Extracting zip files, please wait...
  142.     "7z.exe" e -y "%cd%\tempdl\SDL2.zip" -o"%cd%\other\sdl"
  143.     rmdir /S /Q "%cd%\tempdl"
  144.     del /Q "%cd%\7z.exe"
  145.     echo Done.
  146.     echo Press any key to continue.
  147.     timeout 3 >nul
  148.     cls
  149.     goto :main
  150. )
  151.  
  152. :remove
  153. cls
  154. if exist "%cd%\tempdl" (
  155.     echo Removing files...
  156.     rmdir /S /Q "%cd%\tempdl"
  157.     del /Q "%cd%\7z.exe"
  158.     echo All files successfully removed. Press any key to continue.
  159.     timeout 3 >nul
  160.     cls
  161.     goto :main
  162. ) else (
  163.         echo No files to remove found!
  164.         timeout 3 >nul
  165.         cls
  166.         goto :main
  167. )
  168.  
  169. :remall
  170. cls
  171. if exist "%cd%\other\SDL\alsa" (
  172.     echo Securing default files...
  173.     xcopy "%cd%\other\SDL\VERSION" "%cd%\tempdl" /I /C /Y /Z
  174.     xcopy "%cd%\other\SDL\sdl.lua" "%cd%\tempdl" /I /C /Y /Z
  175.     echo Removing all SDL files...              
  176.     rmdir /S /Q "%cd%\other\SDL"                
  177.     echo Recreating default files...            
  178.     mkdir "%cd%\other\SDL"                      
  179.     xcopy "%cd%\tempdl\VERSION" "%cd%\other\SDL" /I /C /Y /Z
  180.     xcopy "%cd%\tempdl\sdl.lua" "%cd%\other\SDL" /I /C /Y /Z
  181.     rmdir /S /Q "%cd%\tempdl"
  182.     del /Q "%cd%\7z.exe"
  183.     echo All temporary files were successfully removed. Continuing with SDL.
  184.    
  185.     timeout 3 >nul
  186.     cls
  187.     goto :main
  188. )
  189. if not exist "%cd%\tempdl" (
  190.     echo No files to remove found!
  191.     timeout 3 >nul
  192.     cls
  193.     goto :main
  194. )
  195.  
  196. :info
  197. cls
  198. echo +----------------------------------------------------------------+------------+
  199. echo ^|                                                                ^|            ^|
  200. echo ^|             SDL 2 Installer for Teeworlds 0.7 Trunk            ^|    v0.2    ^|
  201. echo ^|                                                                ^|            ^|
  202. echo +----------------------------------------------------------------+------------+
  203. echo +-----------------------------------------------------------------------------+
  204. echo ^|                                                                             ^|
  205. echo ^|  SDL 2 Installer for Teeworlds 0.7 Trunk was made by Blade, for all         ^|
  206. echo ^|  modders out there, who are sick of doing it manualy thereself each and     ^|
  207. echo ^|  every time.                                                                ^|
  208. echo ^|                                                                             ^|
  209. echo ^|  This script uses basic Batch commands, as well as the 7-Zip File Manager   ^|
  210. echo ^|  and LibSDL.                                                                ^|
  211. echo ^|                                                                             ^|
  212. echo ^|  Links :              www.7-zip.org             www.libsdl.org              ^|
  213. echo ^|                                                                             ^|
  214. echo ^|  This tool is free to use as well as to share, but please give credit.      ^|
  215. echo ^|                                                                             ^|
  216. echo +-----------------------------------------------------------------------------+
  217. echo +-----------------------------------------------------------------------------+
  218. echo ^|                                                                             ^|
  219. echo ^|                          Press any key to continue.                         ^|
  220. echo ^|                                                                             ^|
  221. echo +-----------------------------------------------------------------------------+
  222. timeout 30 >nul
  223. goto :main
  224.  
  225. :exit
  226. cls
  227. echo Goodbye!
  228. timeout 3 >nul
  229. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement