-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSETUP_COMPLETE_AUTOMATION.bat
More file actions
152 lines (140 loc) · 4.77 KB
/
SETUP_COMPLETE_AUTOMATION.bat
File metadata and controls
152 lines (140 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@echo off
REM Complete Automation Setup - One Click Solution
REM This configures everything for zero-touch startup
cls
echo ============================================================
echo Local Nexus Controller - Complete Automation Setup
echo ============================================================
echo.
echo This will configure:
echo 1. Controller starts automatically when Windows boots
echo 2. All services start automatically when controller starts
echo 3. Dashboard opens automatically in your browser
echo.
echo Result: Restart Windows = Everything runs automatically!
echo.
echo ============================================================
echo.
echo Press any key to continue or close this window to cancel...
pause > nul
echo.
echo ============================================================
echo Step 1: Verifying Service Auto-Start Configuration
echo ============================================================
echo.
REM Check .env file
if not exist ".env" (
echo [X] ERROR: .env file not found!
echo.
echo Please copy .env.example to .env first:
echo copy .env.example .env
echo.
goto :error
)
REM Check if service auto-start is enabled
findstr /C:"LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true" .env >nul
if %errorlevel% == 0 (
echo [OK] Service auto-start is ENABLED
echo Services will start automatically
) else (
echo [!] Service auto-start is DISABLED
echo Enabling it now...
REM Try to enable it
powershell -Command "(Get-Content .env) -replace 'LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=false', 'LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true' | Set-Content .env"
echo [OK] Service auto-start ENABLED
)
echo.
echo ============================================================
echo Step 2: Setting Up Windows Auto-Start
echo ============================================================
echo.
echo Launching Windows auto-start setup...
echo This requires administrator privileges.
echo.
echo Please click "Yes" when prompted for administrator access.
echo.
REM Launch the Windows auto-start setup
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0tools\setup_auto_start.ps1""' -Verb RunAs -Wait}"
echo.
echo ============================================================
echo Step 3: Verification
echo ============================================================
echo.
REM Check if the task was created
schtasks /query /tn "Local Nexus Controller" >nul 2>&1
if %errorlevel% == 0 (
echo [OK] Windows Task Scheduler task created successfully!
echo.
goto :success
) else (
echo [!] Task not found. Setup may have been cancelled.
echo.
goto :error
)
:success
echo ============================================================
echo SUCCESS! Complete Automation is Now Configured
echo ============================================================
echo.
echo What happens now:
echo.
echo 1. When you log in to Windows:
echo - Controller starts automatically
echo - Runs in background
echo.
echo 2. When controller starts:
echo - All services with start_command auto-start
echo - Logs saved to data/logs/
echo - Dashboard opens in browser
echo.
echo 3. You see:
echo - Browser opens to http://localhost:5010
echo - Green "Running" status for all services
echo - Everything ready to use!
echo.
echo ============================================================
echo Next Steps
echo ============================================================
echo.
echo 1. Test it now (optional):
echo - Start the controller: start.bat
echo - Check dashboard: http://localhost:5010
echo - Verify services are running
echo.
echo 2. Test full automation:
echo - Log out of Windows (or restart)
echo - Log back in
echo - Controller and services start automatically!
echo.
echo 3. View auto-start logs:
echo - Check: data/logs/
echo - Each service has its own log file
echo.
echo ============================================================
echo Configuration Files
echo ============================================================
echo.
echo Service auto-start: .env (LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true)
echo Windows auto-start: Task Scheduler ("Local Nexus Controller")
echo Startup script: tools\start_nexus_on_boot.bat
echo.
echo To disable automation:
echo - Run: tools\DISABLE_AUTO_START.bat
echo.
echo ============================================================
echo.
pause
exit /b 0
:error
echo ============================================================
echo Setup was not completed
echo ============================================================
echo.
echo Please fix the errors above and try again.
echo.
echo For manual setup:
echo 1. Double-click: tools\ENABLE_AUTO_START.bat
echo 2. Or see: AUTO_START_GUIDE.md
echo.
pause
exit /b 1