@ECHO OFF && REM github.com repository
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 ^| 2. Parsisiųsti GNU/Linux/Ubuntu [RUFUS] ^| ECHO ^| 0. Išeiti iš Vaido.World ^| ECHO ^| ^| ECHO ^| ^| ECHO ^| ^| ECHO ^| ^| ECHO ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ECHO Pasirinkite nuspaudus skaičių klaviatūroje . choice /n /c 1234567890 /T 1 /D 1 /m "Tavo pasirinkimas : " if errorlevel 10 ( EXIT ) if errorlevel 1 ( CLS SET "automated=0" GOTO :Download_Linux_Ubuntu_distribution_using_curl_utility ) if errorlevel 2 ( CLS SET "automated=1" 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" SET "hash=MD5" ) ECHO FOUND HERE "%Desktop%\!ubuntu_desktop_filename!" IF "!ubuntu_desktop_filename!"=="" ( SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=2 delims=^*" %%A IN ('curl -s %URL%/SHA256SUMS') DO ( echo %%A | findstr /i /c:"desktop-amd64" >nul && SET "ubuntu_desktop_filename=%%A" SET "hash=SHA256" ) IF "!ubuntu_desktop_filename!"=="" ( ECHO These files have not been found online: ECHO %URL%/MD5SUMS ECHO %URL%/SHA256SUMS ECHO Ubuntu probably deprecated them, or Ubuntu website Internet Address has changed. PAUSE EXIT ) IF EXIST "%Desktop%\!ubuntu_desktop_filename!" ( ECHO Checking !hash! integrity of already existing file SETLOCAL ENABLEDELAYEDEXPANSION set /a count=1 for /f "skip=1 delims=:" %%a in ('CertUtil -hashfile "%Desktop%\!ubuntu_desktop_filename!" !hash!') do ( if !count! equ 1 set "hashChecksum=%%a" set/a count+=1 ) SET hashfile=!hashChecksum! echo File: !hashfile! ECHO Downloading !hash! integrity file from Online Site SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=1 delims=^*" %%A IN ('curl -s wget %URL%/!hash!SUMS ^| findstr /i /c^:^"desktop^"') DO ( set "md5online=%%A" set "md5online=!md5online:~%~1,-1%!" ) echo Online: !md5online! if "!md5online!" == "!hashfile!" ( echo No need to download, the Hash !hash! checksum matched - local image file will be used for Rufus ) ELSE ( echo Ubuntu Image didn't match with Online Hash Checksum, downloading new .iso 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!" 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!" ) if "!automated!"=="0" GOTO :automated 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 --gui --iso="%Desktop%/!ubuntu_desktop_filename!" :automated :wait_for_usb TITLE Waiting for USB FOR /f %%D IN ('wmic LogicalDisk get Caption^, VolumeName ^| find "LINUXUSB"') DO SET "DRIVE=%%D" IF "%DRIVE%"=="" TIMEOUT /T 2 && CLS && GOTO :wait_for_usb CLS ECHO Detected, WAITING FOR DEVICE TIMEOUT /T 4 TITLE Formatting USB ECHO select volume %DRIVE% > "%TEMP%/diskpartlinuxformat.txt" REM ECHO clean >> "%TEMP%/diskpartlinuxformat.txt" REM ECHO create partition primary >> "%TEMP%/diskpartlinuxformat.txt" REM ECHO select partition 1 >> "%TEMP%/diskpartlinuxformat.txt" ECHO format FS=fat32 label=LINUXUSB quick >> "%TEMP%/diskpartlinuxformat.txt" DISKPART /S "%TEMP%/diskpartlinuxformat.txt" TITLE Writing to USB (This will take 4-12 minutes) color 03 tar xfv "%Desktop%/!ubuntu_desktop_filename!" -C "%DRIVE%/" TITLE Linux got installed on your USB DRIVE! FOR /L %%i IN (1,1,10) do ECHO. color 0a ECHO EVERYTHING IS DONE! pause