Advertisement
Guest User

GetSDL.bat

a guest
May 4th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 6.35 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 ^| a - Shows you all informations about this script.                           ^|
  19. echo ^|                                                                             ^|
  20. echo ^|                                                                             ^|
  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%"=="a" (goto :info)
  36.  
  37.  
  38. :download
  39. if exist "%cd%\tempdl" (
  40.  
  41.     if exist "%cd%\tempdl\SDL2.zip" (
  42.         cls
  43.         echo File already Downloaded!
  44.         timeout 3 >nul
  45.         cls
  46.         goto :main
  47.     )
  48.     else (
  49.         cls
  50.         bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.4.zip "%cd%\tempdl\SDL2.zip"
  51.         cls
  52.         echo Download complete!
  53.         echo Press any key to continue.
  54.         timeout 3 >nul
  55.         cls
  56.         goto :main
  57.     )
  58.    
  59. )
  60. else (
  61.     if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
  62.     goto :download
  63. )
  64.  
  65. :install
  66. cls
  67. if exist "%cd%\tempdl\SDL2.zip" (
  68.     echo Extracting zip files, please wait...
  69.     "%ProgramFiles%\7-Zip\7z.exe" e -y "%cd%/tempdl/SDL2.zip" -o"%cd%/other/sdl"
  70.     rmdir /S /Q "%cd%/tempdl"
  71.     echo Done.
  72.     echo Press any key to continue.
  73.     timeout 3 >nul
  74.     cls
  75.     goto :main
  76. )
  77. else (
  78.     cls
  79.     echo No file found!
  80.     timeout 3 >nul
  81.     cls
  82.     goto :main
  83. )
  84.  
  85. :complete
  86. if exist "%cd%\tempdl" (
  87.     if exist "%cd%\tempdl\SDL2.zip" (
  88.             cls
  89.             goto :install
  90.         )
  91.         else (
  92.             cls
  93.             bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.4.zip "%cd%\tempdl\SDL2.zip"
  94.             cls
  95.             echo Download complete!
  96.             echo Press any key to continue.
  97.             timeout 3 >nul
  98.             cls
  99.             goto :main
  100.         )
  101. )
  102.  
  103. else (
  104.     if not exist "%cd%\tempdl" mkdir "%cd%\tempdl"
  105.     bitsadmin.exe /transfer "Downloading SDL2, please wait..." https://www.libsdl.org/release/SDL2-2.0.4.zip "%cd%\tempdl\SDL2.zip"
  106.     cls
  107.     echo Download complete!
  108.     timeout 3 >nul
  109.     cls
  110.     echo Extracting zip files, please wait...
  111.     "%ProgramFiles%\7-Zip\7z.exe" e -y "%cd%/tempdl/SDL2.zip" -o"%cd%/other/sdl"
  112.     rmdir /S /Q "%cd%/tempdl"
  113.     echo Done.
  114.     echo Press any key to continue.
  115.     timeout 3 >nul
  116.     cls
  117.     goto :main
  118. )
  119.  
  120. :remove
  121. cls
  122. if exist "%cd%\tempdl" (
  123.     echo Removing files...
  124.     rmdir /S /Q "%cd%/tempdl"
  125.     echo All files successfully removed. Press any key to continue.
  126.     timeout 3 >nul
  127.     cls
  128.     goto :main
  129. )
  130. if not exist "%cd%\tempdl" (
  131.     echo No files to remove found!
  132.     timeout 3 >nul
  133.     cls
  134.     goto :main
  135. )
  136.  
  137. :info
  138. cls
  139. echo +-----------------------------------------------------------------------------+
  140. echo ^|                                                                             ^|
  141. echo ^|                   SDL 2 Installer for Teeworlds 0.7 Trunk                   ^|
  142. echo ^|                                                                             ^|
  143. echo +-----------------------------------------------------------------------------+
  144. echo +-----------------------------------------------------------------------------+
  145. echo ^|                                                                             ^|
  146. echo ^|  SDL 2 Installer for Teeworlds 0.7 Trunk was made by Blade, for all         ^|
  147. echo ^|  modders out there, who are sick of doing it manualy thereself each and     ^|
  148. echo ^|  every time.                                                                ^|
  149. echo ^|                                                                             ^|
  150. echo ^|  This script uses basic Batch commands, as well as the 7-Zip File Manager   ^|
  151. echo ^|  and LibSDL.                                                                ^|
  152. echo ^|                                                                             ^|
  153. echo ^|  Links :              www.7-zip.org             www.libsdl.org              ^|
  154. echo ^|                                                                             ^|
  155. echo ^|  This tool is free to use as well as to share, but please give credit.      ^|
  156. echo ^|                                                                             ^|
  157. echo +-----------------------------------------------------------------------------+
  158. echo +-----------------------------------------------------------------------------+
  159. echo ^|                                                                             ^|
  160. echo ^|                          Press any key to continue.                         ^|
  161. echo ^|                                                                             ^|
  162. echo +-----------------------------------------------------------------------------+
  163. timeout 30 >nul
  164. goto :main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement