80 lines
2.2 KiB
C#
80 lines
2.2 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using ZA.CoreService.ESBCertificateManager.Configuration;
|
|
using ZA.CoreService.ESBCertificateManager.Models;
|
|
using ZA.CoreService.ESBCertificateManager.Services;
|
|
using ZA.CoreService.ESBCertificateManager.Setup;
|
|
|
|
namespace ZA.CoreService.ESBCertificateManager;
|
|
|
|
internal static class Program
|
|
{
|
|
[STAThread]
|
|
private static void Main()
|
|
{
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
try
|
|
{
|
|
AppSettings settings =
|
|
AppSettingsLoader.Load();
|
|
|
|
SonicSetupRepository repository =
|
|
new(
|
|
settings.Database.ConnectionString);
|
|
|
|
SetupCoordinator coordinator =
|
|
new(
|
|
settings,
|
|
repository);
|
|
|
|
SetupCheckResult setupResult =
|
|
coordinator
|
|
.CheckAsync()
|
|
.GetAwaiter()
|
|
.GetResult();
|
|
|
|
if (setupResult.IsReady)
|
|
{
|
|
using SetupWizardForm setupForm =
|
|
new(coordinator);
|
|
|
|
DialogResult setupDialogResult =
|
|
setupForm.ShowDialog();
|
|
|
|
if (setupDialogResult != DialogResult.OK)
|
|
{
|
|
return;
|
|
}
|
|
|
|
SetupCheckResult finalCheck =
|
|
coordinator
|
|
.CheckAsync()
|
|
.GetAwaiter()
|
|
.GetResult();
|
|
|
|
if (!finalCheck.IsReady)
|
|
{
|
|
MessageBox.Show(
|
|
"Die Einrichtung ist noch nicht vollständig.",
|
|
"Setup unvollständig",
|
|
MessageBoxButtons.OK,
|
|
MessageBoxIcon.Warning);
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
Application.Run(
|
|
new Form1());
|
|
}
|
|
catch (Exception exception)
|
|
{
|
|
MessageBox.Show(
|
|
exception.ToString(),
|
|
"Anwendung konnte nicht gestartet werden",
|
|
MessageBoxButtons.OK,
|
|
MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
} |