@echo off

set PKG_DIR=firmware_release
mkdir="%PKG_DIR%"
xcopy /Y /E /I /H "firmware"      "%PKG_DIR%"
xcopy /Y /E /I /H "Config"        "%PKG_DIR%/MPToolSrc/Config"
xcopy /Y /E /I /H "FlashDB"       "%PKG_DIR%/MPToolSrc/FlashDB"
xcopy /Y /E /I /H "LightSwitch"   "%PKG_DIR%/MPToolSrc/LightSwitch"
xcopy /Y /E /I /H "PretestOption" "%PKG_DIR%/MPToolSrc/PretestOption"
xcopy /Y /E /I /H "SM2262_EzTool"                           "%PKG_DIR%/SM2262_EzTool"
copy System.ini        %PKG_DIR%\MPToolSrc\

cd "%PKG_DIR%/SM2262_EzTool"
for /d %%i in (RS232Info_COM*) do @rmdir /S /Q "%%i"
for /d %%i in (LogInfo_*) do @rmdir /S /Q "%%i"
for %%i in (*.bin) do @del "%%i"
for %%i in (*.bak) do @del "%%i"
