-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (32 loc) · 1.03 KB
/
Program.cs
File metadata and controls
34 lines (32 loc) · 1.03 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
/* In the name of God, the Merciful, the Compassionate */
using System;
using System.Linq;
using System.Windows;
namespace SQLTriage
{
/// <summary>
/// Custom entry point that supports both WPF (default) and Windows Service (--service) modes.
/// Install as service: SQLTriage.exe --service --install [--username DOMAIN\user --password pass]
/// Uninstall service: SQLTriage.exe --service --uninstall
/// Run as service: SQLTriage.exe --service
/// </summary>
public static class Program
{
[STAThread]
public static void Main(string[] args)
{
if (args.Contains("--service", StringComparer.OrdinalIgnoreCase))
{
// Headless Windows Service mode — Kestrel only, no WPF
Data.Services.WindowsServiceHost.Run(args);
}
else
{
// Normal WPF application
var app = new App();
app.InitializeComponent();
app.Run();
}
}
}
}