@@ -3,19 +3,21 @@ title NoteForge Builder
33cd /d " %~dp0 "
44
55echo ============================================
6- echo NoteForge — Build Windows Installer
6+ echo NoteForge — Build
7+ echo ============================================
8+ echo .
9+ echo RECOMMENDED: Push a git tag to build the
10+ echo installer via GitHub Actions:
11+ echo .
12+ echo git tag v2.5.2
13+ echo git push origin v2.5.2
14+ echo .
15+ echo The installer will appear on the Releases
16+ echo page automatically.
717echo ============================================
818echo .
919
10- :: Prevent code signing (no certificate)
1120set CSC_IDENTITY_AUTO_DISCOVERY = false
12- set WIN_CSC_LINK =
13-
14- :: Clear corrupted signing cache if it exists
15- if exist " %LOCALAPPDATA% \electron-builder\Cache\winCodeSign" (
16- echo Clearing signing cache...
17- rd /s /q " %LOCALAPPDATA% \electron-builder\Cache\winCodeSign" 2 > nul
18- )
1921
2022where node > nul 2 >& 1
2123if %errorlevel% neq 0 (
@@ -26,33 +28,52 @@ if %errorlevel% neq 0 (
2628)
2729
2830if not exist " node_modules" (
29- echo [1/3] Installing dependencies...
31+ echo Installing dependencies...
3032 call npm install
3133 if %errorlevel% neq 0 (echo [ERROR] npm install failed. & pause & exit /b 1)
32- ) else (
33- echo [1/3] Dependencies OK.
3434)
3535echo .
3636
37- echo [2/3] Compiling JSX...
37+ echo Compiling JSX...
3838call npx babel app.jsx --out-file app.js --presets=@ babel/preset-react
3939if %errorlevel% neq 0 (echo [ERROR] JSX compile failed. & pause & exit /b 1)
4040echo .
4141
42- echo [3/3] Building installer and portable exe...
42+ echo Building installer (requires Developer Mode or Admin)...
43+ echo Enable Developer Mode: Settings -^ > System -^ > For developers
44+ echo .
45+
46+ :: Clear corrupted signing cache
47+ if exist " %LOCALAPPDATA% \electron-builder\Cache\winCodeSign" (
48+ rd /s /q " %LOCALAPPDATA% \electron-builder\Cache\winCodeSign" 2 > nul
49+ )
50+
4351call npx electron-builder --win
44- if %errorlevel% neq 0 (echo [ERROR] Build failed. & pause & exit /b 1)
52+ if %errorlevel% neq 0 (
53+ echo .
54+ echo ============================================
55+ echo Local build failed.
56+ echo .
57+ echo This usually means Developer Mode is not
58+ echo enabled. You have two options:
59+ echo .
60+ echo 1. Enable Developer Mode in Windows:
61+ echo Settings -^ > System -^ > For developers
62+ echo Then run Build.bat again.
63+ echo .
64+ echo 2. Use GitHub Actions instead (recommended):
65+ echo git tag v2.5.2
66+ echo git push origin v2.5.2
67+ echo ============================================
68+ pause
69+ exit /b 1
70+ )
4571echo .
4672
4773echo ============================================
4874echo Build complete!
49- echo .
50- echo Look in the dist\ folder for:
51- echo - NoteForge Setup x.x.x.exe (installer)
52- echo - NoteForge-x.x.x-portable.exe
75+ echo Output: dist\
5376echo ============================================
54- echo .
55-
5677set /p open = " Open dist folder? (Y/N): "
5778if /i " %open% " == " Y" explorer " dist"
5879pause
0 commit comments