mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-23 19:59:31 +01:00
Initial
This commit is contained in:
48
Code/IO/Setup.cs
Normal file
48
Code/IO/Setup.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user