2020-11-23 16:51:05 +01:00
|
|
|
|
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()))
|
|
|
|
|
|
{
|
2020-11-26 20:17:18 +01:00
|
|
|
|
Logger.Log("Install invalid - Reason: " + Paths.GetPkgPath() + " does not exist.", true);
|
2020-11-23 16:51:05 +01:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach(FlowPackage pkg in PkgInstaller.packages)
|
|
|
|
|
|
{
|
|
|
|
|
|
// if pkg is required and not installed, return false
|
2020-11-25 14:04:31 +01:00
|
|
|
|
if (pkg.friendlyName.ToLower().Contains("required") && !PkgUtils.IsInstalled(pkg))
|
2020-11-23 16:51:05 +01:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|