Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. @echo off
  2.  
  3. rem script: @rgadguard and abbodi406
  4.  
  5. setlocal EnableExtensions
  6. setlocal EnableDelayedExpansion
  7. set "params=%*"
  8. cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
  9.  
  10. if not exist "%cd%\bin\wimlib-imagex.exe" goto :Convert_lite
  11. :GO_DOWN
  12.  
  13. for /f "tokens=3 delims=: " %%b in ('dism /english /online /Get-Intl ^| find /i "System locale"') do (
  14. call bin\lang-uup.cmd -en
  15. if /i %%b==ru-RU call bin\lang-uup.cmd -ru
  16. )
  17. set "file_main=%~n0"
  18. set "aria2=bin\aria2c.exe"
  19. set "rand=%random%"
  20. set "down_temp=%rand%\down"
  21. set "aria2Script=%rand%\aria2_script.txt"
  22. set "BuildInfo=19041.113"
  23. set "lang_def=pl-pl"
  24. set "destDir=uup/!BuildInfo!/!lang_def!/amd64"
  25. set "updateId=83bfec2a-6639-4faf-b866-bf111a372f9d"
  26. mkdir %rand%
  27.  
  28. %aria2% -x16 -s16 -d"%rand%" -o"aria2_script.txt" "https://uup.rg-adguard.net/api/GetFiles?id=!updateId!&lang=!lang_def!&edition=professional&txt=yes"
  29. if %ERRORLEVEL% GTR 0 goto DOWNLOAD_ERROR
  30. for %%i in ("%aria2Script%") do (if /i %%~zi LEQ 10 goto ERROR_API)
  31.  
  32. :Tools
  33. set update_en=OFF
  34. set update_num=0
  35. for /f "tokens=1 skip=2" %%a in ('find /N "Windows10.0-KB" "%aria2Script%"') do (
  36. set /a update_num+=1
  37. )
  38. for /f "tokens=6 delims=[]. " %%G in ('ver') do (
  39. if %%G LEQ 9599 set update_num=0
  40. )
  41. if /i %update_num% neq 0 (set update_en=ON)
  42.  
  43. :Go_down
  44. title %lang_titke_download%...
  45. %aria2% -x16 -s16 -j5 -c -R -d"%destDir%" -i"%aria2Script%"
  46. if %ERRORLEVEL% GTR 0 goto DOWNLOAD_ERROR
  47. erase /q /s "%aria2Script%" >NUL 2>&1
  48.  
  49. color 0a
  50. call bin\convert-UUP.cmd %cd%\uup\!BuildInfo!\!lang_def!\amd64 %update_en%
  51. goto EOF
  52.  
  53. :Convert_lite
  54. for /f "tokens=3 delims=:. " %%f in ('bitsadmin.exe /CREATE /DOWNLOAD "Download convert_lite" ^| findstr "Created job"') do set GUID=%%f
  55. title Download convert_lite...
  56. bitsadmin /transfer %GUID% /download /priority foreground https://uup.rg-adguard.net/dl/convert_lite.cab "%cd%\convert_lite.cab"
  57. if NOT EXIST convert_lite.cab goto ERROR_API
  58. expand convert_lite.cab -f:* %cd% >nul
  59. del /f /q convert_lite.cab >nul 2>&1
  60. goto :GO_DOWN
  61.  
  62. :DOWNLOAD_ERROR
  63. color 0c
  64. echo We have encountered an error while downloading files.
  65. erase /q /s "%aria2Script%" >NUL 2>&1
  66. pause
  67. goto EOF
  68.  
  69. :ERROR_API
  70. color 0c
  71. echo Error getting links to download UUP files.
  72. echo Try again a few minutes later.
  73. erase /q /s "%aria2Script%" >NUL 2>&1
  74. pause
  75. goto EOF
  76.  
  77. :EOF
  78. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement