@ECHO OFF
::
CLS

color 0E
SET "_username=%username%" 
SET "_mypath=%CD%"

ECHO.
ECHO =========================
ECHO.
ECHO [1] Install RINABase Game Assets
ECHO [2] Uninstall RINABase Game Assets
ECHO [3] Check Asset Installation
ECHO [4] Open Roblox Directory (C:\Users\%_username%\AppData\Local\Roblox)
ECHO.
ECHO =========================
ECHO.

CHOICE /C 1234 /M "Type a number from the list:"
CLS

IF ERRORLEVEL 4 GOTO OpenStudioDirectory
IF ERRORLEVEL 3 GOTO CheckInstallation
IF ERRORLEVEL 2 GOTO Uninstall
IF ERRORLEVEL 1 GOTO DefaultInstall

:DefaultInstall
dir .\
DEL C:\Users\%_username%\AppData\Local\Roblox\GlobalSettings_13.xml
powershell -Command "(gc Install\TemplateGlobalSettings_13.xml) -replace 'CMDUSERNAMECHANGE', '%_username%' -replace 'CMDDIRECTORYLOCALASSETS', '%_mypath%' | Out-File -encoding ASCII C:\Users\%_username%\AppData\Local\Roblox\GlobalSettings_13.xml"
GOTO End

:Uninstall
DEL C:\Users\%_username%\AppData\Local\Roblox\GlobalSettings_13.xml
ECHO Game Assets Uninstalled Successfully!
GOTO End

:CheckInstallation
IF EXIST C:\Users\%_username%\AppData\Local\Roblox\GlobalSettings_13.xml (
    ECHO Game Assets are installed.
) ELSE (
    ECHO Game Assets are not installed.
)
GOTO End

:OpenStudioDirectory
START "" "C:\Users\%_username%\AppData\Local\Roblox"
GOTO End

:End
PAUSE

