SkeletonKing

Batch Updater/Installer Script

Oct 2nd, 2016
443
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. title Installer
  3. color f2
  4. if not exist "INSTALL_DIRECTORY" mkdir INSTALL_DIRECTORY
  5. cls
  6. if exist "INSTALL_DIRECTORY\version.txt" bitsadmin /transfer Version /download /priority foreground http://getlink.s2u.vn/redirect.php?link=www.mediafire.com/file/1234567890/version.txt C:\Temp\version.txt & goto update
  7. if not exist "INSTALL_DIRECTORY\version.txt" bitsadmin /transfer Install /download /priority foreground http://getlink.s2u.vn/redirect.php?link=www.mediafire.com/file/1234567890/YOUR_BATCH.bat "INSTALL_DIRECTORY\YOUR_BATCH.bat" & goto status
  8.  
  9. :update
  10. cls
  11. ping localhost -n 1 > nul
  12. set /p version=<"C:\Temp\version.txt"
  13. set /p versionold=<"INSTALL_DIRECTORY\version.txt"
  14. if %version% gtr %versionold% goto updater
  15. if %version% leq %versionold% goto final
  16. goto final
  17.  
  18. :updater
  19. cls
  20. ping localhost -n 1 > nul
  21. rd /s /q "INSTALL_DIRECTORY"
  22. ping localhost -n 1 > nul
  23. mkdir "INSTALL_DIRECTORY"
  24. ping localhost -n 1 > nul
  25. cls
  26. bitsadmin /transfer Update /download /priority foreground http://getlink.s2u.vn/redirect.php?link=www.mediafire.com/file/1234567890/YOUR_BATCH.bat "INSTALL_DIRECTORY\YOUR_BATCH.bat"
  27. goto status
  28.  
  29. :status
  30. echo.
  31. echo.
  32. ping localhost -n 1 > nul
  33. color fa
  34. if exist "INSTALL_DIRECTORY\YOUR_BATCH.bat" echo Success! & echo. & pause & exit
  35. color fc
  36. if not exist "INSTALL_DIRECTORY\YOUR_BATCH.bat" echo Falure! & echo. & pause & exit
  37.  
  38. :final
  39. echo.
  40. echo.
  41. ping localhost -n 1 > nul
  42. echo No New Version Available.
  43. echo.
  44. echo You Are Up To Date!
  45. pause
  46. exit
  47.  
  48. :fail
  49. echo.
  50. echo.
  51. ping localhost -n 1 > nul
  52. echo Could Not Update.
  53. echo.
  54. echo Have You Installed It Yet?
  55. pause
  56. exit
RAW Paste Data