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:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
|
bundle/
|
||||||
|
release/
|
||||||
.kisync.json
|
.kisync.json
|
||||||
.kisync-state.json
|
.kisync-state.json
|
||||||
|
|||||||
55
install.bat
Normal file
55
install.bat
Normal 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
|
||||||
1501
package-lock.json
generated
1501
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
|
"bundle": "esbuild dist/index.js --bundle --platform=node --target=node18 --outfile=bundle/kisync.js",
|
||||||
|
"package": "npm run build && npm run bundle && pkg bundle/kisync.js --targets node18-win-x64 --output release/kisync.exe",
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"start": "node dist/index.js"
|
"start": "node dist/index.js"
|
||||||
},
|
},
|
||||||
@@ -19,6 +21,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.10.0",
|
"@types/node": "^20.10.0",
|
||||||
"@types/node-fetch": "^2.6.9",
|
"@types/node-fetch": "^2.6.9",
|
||||||
|
"@yao-pkg/pkg": "^5.11.0",
|
||||||
|
"esbuild": "^0.20.0",
|
||||||
"typescript": "^5.3.2",
|
"typescript": "^5.3.2",
|
||||||
"ts-node": "^10.9.2"
|
"ts-node": "^10.9.2"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user