@echo off setlocal cd /d "%~dp0" title Haining Card Reader package where powershell.exe >nul 2>&1 if errorlevel 1 ( echo [ERROR] PowerShell was not found. pause exit /b 1 ) powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0build.ps1" set "RESULT=%ERRORLEVEL%" echo. if not "%RESULT%"=="0" ( echo Packaging failed. Review the error above. pause exit /b %RESULT% ) echo Packaging completed. Open the dist folder to find HainingCardReader.exe. start "" "%~dp0dist" pause