Upload Create_Cache.bat
Browse files
runtime-patches/5.3.3/setup/Create_Cache.bat
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
REM AutoMosaRakku Triton Cache Prebuild Tool
|
| 3 |
+
REM Creates Triton cache to prevent timeout during first object removal
|
| 4 |
+
|
| 5 |
+
setlocal EnableDelayedExpansion
|
| 6 |
+
chcp 65001 >nul 2>&1
|
| 7 |
+
|
| 8 |
+
REM Ensure working directory is the parent directory (distribution root)
|
| 9 |
+
REM Create_Cache.bat is now in setup/ subdirectory, so we need to go up one level
|
| 10 |
+
pushd "%~dp0.."
|
| 11 |
+
|
| 12 |
+
REM Isolate from any system Python (same reason as Setup.bat)
|
| 13 |
+
set PYTHONNOUSERSITE=1
|
| 14 |
+
set PYTHONPATH=
|
| 15 |
+
|
| 16 |
+
echo.
|
| 17 |
+
echo ========================================================
|
| 18 |
+
echo AutoMosaRakku Triton Cache Prebuild Tool
|
| 19 |
+
echo ========================================================
|
| 20 |
+
echo.
|
| 21 |
+
echo This tool creates Triton cache for object removal feature.
|
| 22 |
+
echo Prevents long processing time and timeouts on first use.
|
| 23 |
+
echo.
|
| 24 |
+
echo Note: This process may take several minutes.
|
| 25 |
+
echo.
|
| 26 |
+
|
| 27 |
+
if not defined AUTOPILOT pause
|
| 28 |
+
|
| 29 |
+
echo.
|
| 30 |
+
echo [START] Starting Triton cache creation...
|
| 31 |
+
echo.
|
| 32 |
+
|
| 33 |
+
REM Configure MSVC environment (required for triton-windows)
|
| 34 |
+
echo [CONFIG] Setting up MSVC environment...
|
| 35 |
+
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" (
|
| 36 |
+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1
|
| 37 |
+
echo [OK] MSVC Build Tools environment configured
|
| 38 |
+
) else if exist "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" (
|
| 39 |
+
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1
|
| 40 |
+
echo [OK] MSVC Community environment configured
|
| 41 |
+
) else (
|
| 42 |
+
echo [WARNING] MSVC not found. Please run Setup.bat first.
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
REM Execute cache creation using secure launcher (handles encrypted files)
|
| 46 |
+
echo.
|
| 47 |
+
echo [EXEC] Running encrypted environment cache creation...
|
| 48 |
+
echo Current directory: %CD%
|
| 49 |
+
python_base\python.exe runtime\secure_launcher_v2.py --cache-only
|
| 50 |
+
|
| 51 |
+
REM Check execution result
|
| 52 |
+
if %errorlevel% equ 0 (
|
| 53 |
+
echo.
|
| 54 |
+
echo ========================================================
|
| 55 |
+
echo [SUCCESS] Triton cache creation completed
|
| 56 |
+
echo ========================================================
|
| 57 |
+
echo.
|
| 58 |
+
echo Object removal processing will be faster next time.
|
| 59 |
+
echo Start the application and try the object removal feature.
|
| 60 |
+
echo.
|
| 61 |
+
) else (
|
| 62 |
+
echo.
|
| 63 |
+
echo ========================================================
|
| 64 |
+
echo [FAILED] Triton cache creation failed
|
| 65 |
+
echo ========================================================
|
| 66 |
+
echo.
|
| 67 |
+
echo Troubleshooting:
|
| 68 |
+
echo 1. Make sure Setup.bat has been executed and completed
|
| 69 |
+
echo 2. Ensure NVIDIA GPU drivers are up to date
|
| 70 |
+
echo 3. Run this batch file with administrator privileges
|
| 71 |
+
echo.
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
echo Cache directory check:
|
| 75 |
+
if exist "%USERPROFILE%\.triton\cache" (
|
| 76 |
+
echo [OK] %USERPROFILE%\.triton\cache
|
| 77 |
+
dir "%USERPROFILE%\.triton\cache" /b | find /c /v "" > nul
|
| 78 |
+
if not errorlevel 1 (
|
| 79 |
+
for /f %%i in ('dir "%USERPROFILE%\.triton\cache" /b ^| find /c /v ""') do echo Cache files count: %%i
|
| 80 |
+
)
|
| 81 |
+
) else (
|
| 82 |
+
echo [INFO] Triton cache directory was not created
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
echo.
|
| 86 |
+
if not defined AUTOPILOT (
|
| 87 |
+
echo Batch execution completed. Press any key to exit...
|
| 88 |
+
pause >nul
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
REM Restore original directory
|
| 92 |
+
popd
|