jakimfett

PiTek Launcher script v1.4

Feb 18th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo Download this script from http://pitek.planetbeast.net:8030/
  2. @echo Off
  3. IF EXIST "%UserProfile%\pitek.jar" (
  4.     call:startPiTek
  5.     GOTO:EOF
  6. ) else (
  7.     call:trySimpleDownload
  8.     call:checkStart
  9.      
  10. )
  11. GOTO:EOF
  12.  
  13. :trySimpleDownload
  14. IF EXIST "C:\Windows\System32\bitsadmin.exe" (
  15.     "C:\Windows\System32\bitsadmin.exe" /transfer "PiTekDownloader" http://pitek.planetbeast.net:8030/launcher.jar "%UserProfile%\pitek.jar"
  16.     CLS
  17. )
  18. GOTO:EOF
  19.  
  20. :checkStart
  21. IF EXIST "%UserProfile%\pitek.jar" (
  22.     call:startPiTek
  23. ) ELSE (
  24.     call:longDownload
  25.     CLS
  26.     "C:\Windows\System32\bitsadmin.exe" /reset
  27.     CLS
  28.     call:startPiTek
  29. )
  30. GOTO:EOF
  31.  
  32. :longDownload
  33. IF EXIST "C:\Windows\System32\bitsadmin.exe" (
  34.     "C:\Windows\System32\bitsadmin.exe" /create "PiTekDownloader"
  35.     "C:\Windows\System32\bitsadmin.exe" /addfile "PiTekDownloader" http://pitek.planetbeast.net:8030/launcher.jar "%UserProfile%\pitek.jar"
  36.     "C:\Windows\System32\bitsadmin.exe" /resume "PiTekDownloader"
  37.     CLS
  38.     call:waitForDownload
  39. )
  40. GOTO:EOF
  41.  
  42. :waitForDownload
  43. "C:\Windows\System32\ping.exe" 127.0.0.1 -n 2 > nul
  44. for /f %%i in ('C:\Windows\System32\bitsadmin.exe /GetState PiTekDownloader') do set downloadStatus=%%i
  45. IF %downloadStatus%==TRANSFERRED (
  46.     "C:\Windows\System32\bitsadmin.exe" /complete "PiTekDownloader"
  47.     GOTO:EOF
  48. )
  49. CLS
  50. "C:\Windows\System32\bitsadmin.exe" /info "PiTekDownloader"
  51. call:waitForDownload
  52. GOTO:EOF
  53.  
  54. :startPiTek
  55. IF EXIST "%UserProfile%\pitek.jar" (
  56.     IF EXIST "C:\Program Files\Java\jre7\bin\javaw.exe" (
  57.         @echo On
  58.         echo This window will automatically close when Minecraft starts.
  59.         echo Please do not manually close this window.
  60.         echo Starting PiTek custom launcher...
  61.         @echo Off
  62.         "C:\Program Files\Java\jre7\bin\javaw.exe" -Xms512M -Xmx1G -jar "%UserProfile%\pitek.jar"
  63.         GOTO:EOF
  64.     ) ELSE (
  65.         @echo On
  66.         echo Please download and install java!
  67.         echo ----------------------------------
  68.         echo If you already have java installed
  69.         echo make sure you're running 64 bit java
  70.        pause
  71.        GOTO:EOF
  72.    )
  73. )
  74. GOTO:EOF
  75.  
  76. :manualDownload
  77. @echo On
  78. echo Please manually download the PiTek launcher
  79. echo from http://pitek.planetbeast.net:8030/
  80. echo and place it in C:\Users\yourusername\
  81. pause
  82. GOTO:EOF
Advertisement
Add Comment
Please, Sign In to add comment