Files
juc500/scripts/apply_offline_update.bat
T
2026-07-21 21:04:25 +09:00

79 lines
2.6 KiB
Batchfile

@echo off
REM Offline overlay update for closed-network Windows 11.
REM Run from the extracted update folder (or pass DEST as arg 1).
setlocal EnableExtensions
set "SRC=%~dp0"
if "%SRC:~-1%"=="\" set "SRC=%SRC:~0,-1%"
REM If this bat lives in scripts\, SRC is package root when called as scripts\apply...
if exist "%SRC%\juc500_xfer\usb_link.py" goto :have_src
if exist "%SRC%\..\juc500_xfer\usb_link.py" (
set "SRC=%SRC%\.."
goto :have_src
)
echo [!] juc500_xfer not found next to this script.
echo Extract the offline update zip first, then run this bat from that folder.
exit /b 1
:have_src
set "DEST=%~1"
if "%DEST%"=="" set "DEST=C:\dev\juc500"
echo === JUC500 offline update ===
echo SRC = %SRC%
echo DEST= %DEST%
if not exist "%DEST%" (
echo [!] DEST missing: %DEST%
echo Create it or pass path: apply_offline_update.bat D:\juc500
exit /b 1
)
echo.
echo Copying runtime sources...
robocopy "%SRC%\juc500_xfer" "%DEST%\juc500_xfer" /E /XD __pycache__ .git /NFL /NDL /NJH /NJS /nc /ns /np
if errorlevel 8 exit /b 1
if exist "%SRC%\scripts" (
robocopy "%SRC%\scripts" "%DEST%\scripts" /E /XD __pycache__ /NFL /NDL /NJH /NJS /nc /ns /np
)
for %%F in (start.bat start.sh start_win.sh start_both.sh juc500_app.py requirements.txt README.md) do (
if exist "%SRC%\%%F" copy /Y "%SRC%\%%F" "%DEST%\%%F" >nul
)
if exist "%SRC%\vendor\libusb-1.0.dll" (
if not exist "%DEST%\vendor" mkdir "%DEST%\vendor"
copy /Y "%SRC%\vendor\libusb-1.0.dll" "%DEST%\vendor\libusb-1.0.dll" >nul
if exist "%DEST%\.venv\Scripts" copy /Y "%SRC%\vendor\libusb-1.0.dll" "%DEST%\.venv\Scripts\libusb-1.0.dll" >nul
)
if exist "%SRC%\vendor\wheels" (
if not exist "%DEST%\vendor\wheels" mkdir "%DEST%\vendor\wheels"
robocopy "%SRC%\vendor\wheels" "%DEST%\vendor\wheels" *.whl /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "%SRC%\vendor\tools\zadig.exe" (
if not exist "%DEST%\vendor\tools" mkdir "%DEST%\vendor\tools"
copy /Y "%SRC%\vendor\tools\zadig.exe" "%DEST%\vendor\tools\zadig.exe" >nul
)
if exist "%SRC%\docs" (
if not exist "%DEST%\docs" mkdir "%DEST%\docs"
robocopy "%SRC%\docs" "%DEST%\docs" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
echo.
echo Verifying build tag...
if exist "%DEST%\.venv\Scripts\python.exe" (
"%DEST%\.venv\Scripts\python.exe" -c "from juc500_xfer.usb_link import XFER_BUILD; print('XFER_BUILD=', XFER_BUILD)"
) else (
echo [.venv missing — run start.bat once to bootstrap from vendor]
)
echo.
echo Done. Close JUC500 GUI, then:
echo cd /d %DEST%
echo start.bat
echo GUI should show build tag from BUILD.txt (e.g. 2026-07-21-juc500-only).
echo JUC500: Zadig MI_05 WinUSB on 0711:7500 — vendor\tools\zadig.exe
endlocal
exit /b 0