Files
flowframes/Code/IO/Setup.cs
N00MKRAD 1bce73dea6 Initial
2020-11-23 16:51:05 +01:00

49 lines
988 B
C#

using Flowframes.IO;
using Flowframes.Properties;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Flowframes.Forms;
namespace Flowframes
{
class Setup
{
public static void Init()
{
Console.WriteLine("Setup Init()");
if (!InstallIsValid())
{
Logger.Log("No valid installation detected");
new InstallerForm().ShowDialog();
}
else
{
}
}
public static bool InstallIsValid ()
{
if (!Directory.Exists(Paths.GetPkgPath()))
{
Logger.Log("Install invalid - Reason: " + Paths.GetPkgPath() + " does not exist.");
return false;
}
foreach(FlowPackage pkg in PkgInstaller.packages)
{
// if pkg is required and not installed, return false
if (pkg.friendlyName.ToLower().Contains("required") && !PkgInstaller.IsInstalled(pkg.fileName))
return false;
}
return true;
}
}
}