Skip to content

Commit 567bbe8

Browse files
refactor: update engine management in dashboard to allow background operation and prevent closure on UI exit
1 parent 44c474e commit 567bbe8

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

dashboard/lib/main.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:sentracore_dashboard/providers/settings_provider.dart';
77
import 'package:sentracore_dashboard/navigation/dashboard_navigation.dart';
88
import 'package:sentracore_dashboard/screens/dashboard_screen.dart';
99
import 'package:sentracore_dashboard/services/desktop_notification_service.dart';
10-
import 'package:sentracore_dashboard/services/engine_bundled_launcher.dart';
1110
import 'package:sentracore_dashboard/theme/app_theme.dart';
1211

1312
Future<void> main() async {
@@ -143,9 +142,8 @@ class SentraCoreApp extends StatefulWidget {
143142
class _SentraCoreAppState extends State<SentraCoreApp> {
144143
@override
145144
void dispose() {
146-
// Allow the app to stop the engine on close (owned process only).
147-
// Users can still kill the process externally; we auto-restart on next launch.
148-
EngineBundledLauncher.stopOwnedEngine();
145+
// Do not stop the engine when the dashboard closes.
146+
// The engine is designed to run in the background and should survive UI restarts.
149147
super.dispose();
150148
}
151149

installer/sentracore.iss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ Name: "{group}\Uninstall SentraCore"; Filename: "{uninstallexe}"
3434
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional icons:"
3535

3636
[Registry]
37-
; Always run engine on user login (background)
38-
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "SentraCoreEngine"; ValueData: """{app}\SentraCoreEngine.exe"""
37+
; Always run engine on user login (hidden).
38+
; Running the engine exe directly from HKCU\Run can flash a console window; use PowerShell to start it hidden.
39+
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "SentraCoreEngine"; ValueData: """{sys}\WindowsPowerShell\v1.0\powershell.exe"" -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command ""Start-Process -FilePath '{app}\SentraCoreEngine.exe' -WindowStyle Hidden"""
3940

4041
[Run]
4142
; Always start engine after install (background)
42-
Filename: "{app}\SentraCoreEngine.exe"; Flags: nowait postinstall runhidden
43+
Filename: "{app}\SentraCoreEngine.exe"; Flags: nowait runhidden
4344
; Optionally launch the dashboard
4445
Filename: "{app}\sentracore_dashboard.exe"; Description: "Launch SentraCore Dashboard"; Flags: nowait postinstall
4546

0 commit comments

Comments
 (0)