@echo off setlocal enabledelayedexpansion pushd %~dp0..\.. set "ROOT=%CD%" call "%ROOT%\scripts\windows\build.bat" if %ERRORLEVEL% neq 0 ( echo build failed popd exit /b 1 ) rem Resolve the real Documents folder (respects OneDrive / folder redirection). for /f "usebackq delims=" %%i in (`powershell -NoProfile -Command "[Environment]::GetFolderPath('MyDocuments')"`) do set "DOCS=%%i" if not defined DOCS set "DOCS=%USERPROFILE%\Documents" set "INSTALL_DIR=%DOCS%\KiCad\10.0\plugins\com.jesshunter.layers" if exist "%INSTALL_DIR%\bin" rmdir /s /q "%INSTALL_DIR%\bin" if exist "%INSTALL_DIR%\resources" rmdir /s /q "%INSTALL_DIR%\resources" if exist "%INSTALL_DIR%\plugin.json" del /q "%INSTALL_DIR%\plugin.json" if exist "%INSTALL_DIR%\LICENCE" del /q "%INSTALL_DIR%\LICENCE" set "STAGE=%ROOT%\build\bin\com.jesshunter.layers" xcopy /e /i /y /q "%STAGE%" "%INSTALL_DIR%" >nul echo installed: %INSTALL_DIR% popd endlocal