voile/Voile/Tasks/StartupInitializeDatabase.cs
2026-01-12 22:51:27 +01:00

44 lines
909 B
C#

using skyscraper5.Skyscraper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Voile.Tasks
{
internal class StartupInitializeDatabase : VoileRunnable
{
public Form1 Form1 { get; internal set; }
private Ini ini;
public void Run()
{
if (IsFirstRun())
{
FirstRunWizard frw = new FirstRunWizard();
DialogResult dr = frw.ShowDialog(Form1);
}
}
private bool IsFirstRun()
{
VoileContext voileContext = VoileContext.GetContext();
FileInfo fileInfo = voileContext.GetVoileIniFile();
if (!fileInfo.Exists)
{
voileContext.Ini = new Ini();
ini = voileContext.Ini;
return true;
}
voileContext.Ini = new Ini(fileInfo.FullName);
bool firstRunComplete = ini.ReadValue("voile", "firstRunComplete", false);
if (!firstRunComplete)
return true;
return false;
}
}
}