Add exe packaging and install.bat

- esbuild bundle + @yao-pkg/pkg for standalone Windows exe
- install.bat copies to %LOCALAPPDATA%\kisync and adds to user PATH
- npm run package to build release/kisync.exe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 16:30:49 +03:00
parent 4c54bfff26
commit f899eeb4ef
4 changed files with 1562 additions and 0 deletions

55
install.bat Normal file
View File

@@ -0,0 +1,55 @@
@echo off
setlocal
set "INSTALL_DIR=%LOCALAPPDATA%\kisync"
set "EXE_NAME=kisync.exe"
echo.
echo KIS API Builder Sync - Installer
echo =================================
echo.
:: Create install directory
if not exist "%INSTALL_DIR%" (
mkdir "%INSTALL_DIR%"
echo Created: %INSTALL_DIR%
)
:: Copy exe
copy /Y "%~dp0release\%EXE_NAME%" "%INSTALL_DIR%\%EXE_NAME%" >nul 2>&1
if errorlevel 1 (
echo ERROR: Could not copy %EXE_NAME%. Make sure release\kisync.exe exists.
echo Run "npm run package" first to build the exe.
pause
exit /b 1
)
echo Installed: %INSTALL_DIR%\%EXE_NAME%
:: Check if already in PATH
echo %PATH% | findstr /I /C:"%INSTALL_DIR%" >nul 2>&1
if %errorlevel%==0 (
echo PATH: already configured
goto :done
)
:: Add to user PATH
echo Adding to user PATH...
for /f "tokens=2*" %%a in ('reg query "HKCU\Environment" /v Path 2^>nul') do set "USER_PATH=%%b"
if defined USER_PATH (
reg add "HKCU\Environment" /v Path /t REG_EXPAND_SZ /d "%USER_PATH%;%INSTALL_DIR%" /f >nul 2>&1
) else (
reg add "HKCU\Environment" /v Path /t REG_EXPAND_SZ /d "%INSTALL_DIR%" /f >nul 2>&1
)
:: Broadcast environment change so new terminals pick it up
rundll32.exe user32.dll,UpdatePerIDesktopLayout >nul 2>&1
echo PATH: added %INSTALL_DIR%
:done
echo.
echo Done! Open a NEW terminal and run:
echo kisync --help
echo.
pause