@ECHO OFF echo "%~n0%~x0"|find "ready_for_execution_" >nul if errorlevel 1 ( MKDIR "%TEMP%\vaidoWorld\" TYPE "%~DP0%~n0%~x0" | FIND "" /V > "%TEMP%\vaidoWorld\ready_for_execution_%~n0%~x0" CALL "%TEMP%\vaidoWorld\ready_for_execution_%~n0%~x0" EXIT ) SETLOCAL EnableDelayedExpansion IF EXIST "%TEMP%\typed" ( FOR /F %%A in ("%~DP0%~n0%~x0") DO SET "current_script_size=%%~zA" FOR /F %%A in ("%TEMP%\typed") DO SET "converted_size=%%~zA" IF "!converted_size!" == "!current_script_size!" ( ECHO are equal !converted_size! eq !current_script_size! ) ELSE ( ECHO Are not equal !converted_size! eq !current_script_size! ) ) CLS :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" taskkill /fi "WINDOWTITLE eq %1*" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) pushd "%CD%" CD /D "%~dp0" :-------------------------------------- @ECHO OFF chcp 65001 > nul echo. echo. echo ██╗ ██╗ █████╗ ██╗██████╗ ██████╗ ██████╗ █████╗ ███████╗ █████╗ ██╗ ██╗██╗ ██╗███████╗ echo ██║ ██║██╔══██╗██║██╔══██╗██╔═══██╗ ██╔══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██║ ██║██╔════╝ echo ██║ ██║███████║██║██║ ██║██║ ██║ ██████╔╝███████║███████╗███████║██║ ██║██║ ██║███████╗ echo ╚██╗ ██╔╝██╔══██║██║██║ ██║██║ ██║ ██╔═══╝ ██╔══██║╚════██║██╔══██║██║ ██║██║ ██║╚════██║ echo ╚████╔╝ ██║ ██║██║██████╔╝╚██████╔╝ ██║ ██║ ██║███████║██║ ██║╚██████╔╝███████╗██║███████║ echo ╚═══╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝╚══════╝ echo Sveiki atvykę į Vaido World. (Alpha versija) ECHO ______________________________________ ECHO ^| 1. Parsisiųsti GNU/Linux/Ubuntu ^| ECHO ^| 0. Išeiti iš Vaido.World ^| ECHO ^| ^| ECHO ^| ^| ECHO ^| ^| ECHO ^| ^| ECHO ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ECHO Pasirinkite nuspaudus skaičių klaviatūroje . choice /n /c 1234567890 /m "Tavo pasirinkimas : " if errorlevel 10 ( EXIT ) if errorlevel 1 ( CLS GOTO :Download_Linux_Ubuntu_distribution_using_curl_utility ) REM CURL utility was introduced in Windows 10 April 2018 Update RS4 :Download_Linux_Ubuntu_distribution_using_curl_utility @ECHO OFF CLS TITLE Vaido Pasaulis chcp 65001 > nul echo. echo [𝐆𝐢𝐭𝐇𝐮𝐛: https://github.com/vaido-world/download-ubuntu] echo ██╗ ██╗ █████╗ ██╗██████╗ ██████╗ ██████╗ █████╗ ███████╗ █████╗ ██╗ ██╗██╗ ██╗███████╗ echo ██║ ██║██╔══██╗██║██╔══██╗██╔═══██╗ ██╔══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██║ ██║██╔════╝ echo ██║ ██║███████║██║██║ ██║██║ ██║ ██████╔╝███████║███████╗███████║██║ ██║██║ ██║███████╗ echo ╚██╗ ██╔╝██╔══██║██║██║ ██║██║ ██║ ██╔═══╝ ██╔══██║╚════██║██╔══██║██║ ██║██║ ██║╚════██║ echo ╚████╔╝ ██║ ██║██║██████╔╝╚██████╔╝ ██║ ██║ ██║███████║██║ ██║╚██████╔╝███████╗██║███████║ echo ╚═══╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝╚══════╝ echo Sveiki atvykę į Vaido World. (Alpha versija) echo. echo Naudojantis šia programa galima parsisiųsti ir įsirašyti Ubuntu/Linux instaliacijos failus echo į savo turimą išorinę laikmeną. echo. echo Įsirašius instaliacijos failus į išorinę laikmeną - bus galima įsirašyti ir pačią Ubuntu/Linux operacinę sistemą. echo. echo [ Parsiunčiama Linux/GNU/Ubuntu operacinė sistema ] echo. @ECHO OFF SETLOCAL EnableDelayedExpansion FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop^|FIND/I "desktop"') DO SET "Desktop=!Desktop!%%B" CALL SET "Desktop=!Desktop!" ECHO Gathering local Date information REM Get current Year and Month for Windows 10 Windows 8.1 Windows 8 Windows 7 FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC.exe Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO ( SET "year_now=!year_now!%%F" SET "month_now=!month_now!%%D" ) SET "year_now=%year_now:~2,2%" ECHO Guessing Ubuntu release cycle... SET "releaseCycle=Interim"; IF "%releaseCycle%" == "LTS" ( SET /A "year=!year_now! - 2" SET "release_version=!year!.04" ) ELSE IF "%releaseCycle%"=="Interim" ( IF %month_now% LSS 4 ( SET /A "year=!year_now! - 1" SET "release_version=!year!.10" ) IF %month_now% LSS 10 ( IF %month_now% GEQ 04 ( SET "release_version=!year_now!.04" ) ) IF %month_now% GEQ 10 ( SET "release_version=!year_now!.10" ) ) ELSE IF "%releaseCycle%"=="Daily" ( IF %month_now% LSS 4 ( SET "release_version=!year_now!.04" ) IF %month_now% LSS 10 ( IF %month_now% GEQ 04 ( SET "release_version=!year_now!.10" ) ) IF %month_now% GEQ 10 ( SET "release_version=!year_now!.10" ) ) ELSE ( echo "Available Ubuntu release cycles: LTS Interim Daily" echo "Please select one of them by assinging one of them to the variable \$releaseCycle" PAUSE EXIT ) IF "%releaseCycle%"=="LTS" ( SET "URL=https://releases.ubuntu.com/%release_version%" ) IF "%releaseCycle%"=="Interim" ( SET "URL=https://releases.ubuntu.com/%release_version%" ) IF "%releaseCycle%"=="Daily" ( SET "URL=https://cdimage.ubuntu.com/daily-live/pending" ) ECHO Downloading and Parsing data from Ubuntu.com ECHO Gathering .iso Filename from remote source SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=2 delims=^*" %%A IN ('curl -s %URL%/MD5SUMS') DO ( echo %%A | findstr /i /c:"desktop-amd64" >nul && SET "ubuntu_desktop_filename=%%A" ) IF EXIST "%Desktop%\!ubuntu_desktop_filename!" ( ECHO Checking MD5 integrity of already existing file SETLOCAL ENABLEDELAYEDEXPANSION set /a count=1 for /f "skip=1 delims=:" %%a in ('CertUtil -hashfile "%Desktop%\!ubuntu_desktop_filename!" MD5') do ( if !count! equ 1 set "md5=%%a" set/a count+=1 ) SET md5file=!md5! echo File: !md5file! ECHO Downloading MD5 integrity from Online Site SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=1 delims=^*" %%A IN ('curl -s wget %URL%/MD5SUMS ^| findstr /i /c^:^"desktop^"') DO ( set "md5online=%%A" set "md5online=!md5online:~%~1,-1%!" ) echo Online: !md5online! if "!md5online!" == "!md5file!" ( echo No need to download, the MD5 matched - local image file will be used for Rufus ) ELSE ( echo Ubuntu Image didn't match with Online MD5, downloading new one ECHO Filename: !ubuntu_desktop_filename! ECHO Download URL: "%URL%/!ubuntu_desktop_filename!" ECHO Downloading to: %Desktop%\!ubuntu_desktop_filename! del "!ubuntu_desktop_filename!" curl --continue-at "-" "%URL%/!ubuntu_desktop_filename!" > "%Desktop%\!ubuntu_desktop_filename!" ) ) ELSE ( ECHO Downloading Linux/GNU/Ubuntu .iso installation disk file ECHO Filename: !ubuntu_desktop_filename! ECHO Download URL: "%URL%/!ubuntu_desktop_filename!" ECHO Downloading to: %Desktop%\!ubuntu_desktop_filename! DEL "%Desktop%\!ubuntu_desktop_filename!" @echo on curl --continue-at "-" "%URL%/!ubuntu_desktop_filename!" > "!Desktop!\!ubuntu_desktop_filename!" ) ECHO Downloading and parsing Data from GitHub API about Rufus Project for /f delims^=^"^ tokens^=4 %%i in ('curl -s https://api.github.com/repos/pbatard/rufus/releases/latest ^| findstr ^"browser_download_url.*exe^" ^| findstr -v ^"arm^" ^| findstr -v ^"p.exe^" ^| findstr -v ^".sig^" ') do ( ECHO Downloading Latest Rufus binary release from GitHub curl --location "%%i" > "%%~nxi" set "rufus_filename=%%~nxi" ) ECHO Renaming Rufus binary name to a name without version ECHO (as that make stops Rufus from checking for latest version according to the Rufus developer) IF EXIST "rufus.exe" del "rufus.exe" ren "%rufus_filename%" "rufus.exe" ECHO Launching Rufus and autoselecting downloaded .iso file rufus.exe --iso="%Desktop%/!ubuntu_desktop_filename!"