Last active
October 30, 2025 06:52
-
-
Save faizul726/2677744f4afd6a564c18bd834183114d to your computer and use it in GitHub Desktop.
Installer script for OreUI Utilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :: Made by github.com/faizul726 | |
| :: Born on 20251030-1126 | |
| @echo off | |
| setlocal enabledelayedexpansion | |
| echo OreUI Utilities Script for Minecraft Bedrock Edition | |
| echo. | |
| pushd "%~dp0" | |
| set "iobitUnlocker=%ProgramFiles(x86)%\IObit\IObit Unlocker\IObitUnlocker.exe" | |
| if not exist "%iobitUnlocker%" ( | |
| echo IObit Unlocker is not installed. Can't continue. | |
| goto exit | |
| ) | |
| set "minecraftLocation=" | |
| echo Getting Minecraft location... | |
| for /f "tokens=* delims=" %%L in ('powershell -NoProfile -Command "(Get-AppxPackage -Name Microsoft.MinecraftUWP).InstallLocation"') do ( | |
| set "minecraftLocation=%%L" | |
| ) | |
| if not defined minecraftLocation ( | |
| echo Minecraft is not installed. Can't continue. | |
| goto exit | |
| ) | |
| set /a backupFileCount=0 | |
| for %%F in ("%minecraftLocation%\data\gui\dist\hbui\*.js.bak") do ( | |
| set "backupFileName=%%~nxF" | |
| set "backupFilePath=%%~fF" | |
| set /a backupFileCount+=1 | |
| ) | |
| if %backupFileCount% gtr 1 ( | |
| echo More than 1 backup file detected. Can't continue. | |
| goto exit | |
| ) | |
| if %backupFileCount% equ 1 ( | |
| echo Backup detected. Do you want to restore? | |
| echo. | |
| echo [Y] Yes [N] No, exit | |
| choice /c yn /n >nul | |
| if !errorlevel! equ 1 ( | |
| call :restore "%backupFileName%" "%backupFilePath%" "%minecraftLocation%" | |
| goto exit | |
| ) | |
| exit /b 0 | |
| ) | |
| set /a fileCounter=0 | |
| for %%F in ("hbui\*.js") do ( | |
| set "fileName=%%~nxF" | |
| set "filePath=%%~fF" | |
| set /a fileCounter+=1 | |
| ) | |
| if %fileCounter% gtr 1 ( | |
| echo More than 1 .js file detected. Can't continue. | |
| goto exit | |
| ) | |
| if %fileCounter% leq 0 ( | |
| echo No .js file found. Can't continue. | |
| goto exit | |
| ) | |
| if not exist "%minecraftLocation%\data\gui\dist\hbui\%fileName%" ( | |
| echo Current Minecraft version is not compatible. Can't continue. | |
| goto exit | |
| ) | |
| echo Confirm installation? | |
| echo. | |
| echo [Y] Yes [N] No, exit | |
| choice /c yn /n >nul | |
| if %errorlevel% equ 1 ( | |
| call :install "%fileName%" "%filePath%" "%minecraftLocation%" | |
| goto exit | |
| ) | |
| exit /b 0 | |
| :exit | |
| echo Press any key to exit... | |
| pause >nul | |
| exit /b 1 | |
| :restore | |
| :: 1 = backupFileName | |
| :: 2 = backupFilePath | |
| :: 3 = minecraftLocation | |
| set "_backupFileName=%~1" | |
| set "currentFileName=%_backupFileName:.js.bak=.js%" | |
| copy /d /b %2 "%cd%" | |
| rename "%_backupFileName%" "%currentFileName%" | |
| :step1_r | |
| echo Step 1/3: Delete current file | |
| "%iobitUnlocker%" /Delete /Advanced "%~3\data\gui\dist\hbui\%currentFileName%" | |
| if %errorlevel% neq 0 (goto step1_r) | |
| :step2_r | |
| echo Step 2/3: Replace file | |
| "%iobitUnlocker%" /Move /Advanced "%cd%\%currentFileName%" "%~3\data\gui\dist\hbui" | |
| if %errorlevel% neq 0 (goto step2_r) | |
| :step3_r | |
| echo Step 3/3: Delete backup file | |
| "%iobitUnlocker%" /Delete /Advanced "%~3\data\gui\dist\hbui\%_backupFileName%" | |
| if %errorlevel% neq 0 (goto step3_r) | |
| echo Done | |
| exit /b 0 | |
| :install | |
| :: 1 = fileName | |
| :: 2 = filePath | |
| :: 3 = minecraftLocation | |
| copy /d /b "%~3\data\gui\dist\hbui\%~1" . | |
| rename %1 "%~1.bak" | |
| :step1_i | |
| echo Step 1/2: Backup | |
| "%iobitUnlocker%" /Move /Advanced "%cd%\%~1.bak" "%~3\data\gui\dist\hbui" | |
| if %errorlevel% neq 0 (goto step1_i) | |
| :step2_i | |
| echo Step 2/3: Delete current file | |
| "%iobitUnlocker%" /Delete /Advanced "%~3\data\gui\dist\hbui\%~1" | |
| if %errorlevel% neq 0 (goto step2_i) | |
| :step3_i | |
| echo Step 3/3: Replace file | |
| "%iobitUnlocker%" /Copy /Advanced %2 "%~3\data\gui\dist\hbui" | |
| if %errorlevel% neq 0 (goto step3_i) | |
| echo Done | |
| exit /b 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment