2021-11-13 22:56:56 +02:00
|
|
|
|
using NLog;
|
|
|
|
|
using System;
|
2021-06-04 22:58:40 +03:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2021-09-02 02:35:20 +03:00
|
|
|
|
namespace Novetus.Bootstrapper
|
2021-06-04 22:58:40 +03:00
|
|
|
|
{
|
|
|
|
|
public partial class NovetusLaunchForm : Form
|
|
|
|
|
{
|
|
|
|
|
public NovetusLaunchForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NovetusLaunchForm_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-09-13 00:26:34 +03:00
|
|
|
|
FileManagement.ReadInfoFile(LocalPaths.InfoPath, true, LocalPaths.LauncherPath);
|
2022-09-05 18:06:03 +03:00
|
|
|
|
ReadConfigValues(LocalPaths.ConfigPath);
|
2021-08-13 22:41:47 +03:00
|
|
|
|
|
2022-09-05 18:06:03 +03:00
|
|
|
|
if (GlobalVars.UserConfiguration.BootstrapperShowUI)
|
2021-11-07 16:29:26 +02:00
|
|
|
|
{
|
2022-09-05 18:06:03 +03:00
|
|
|
|
//use novetus font for label!!
|
2021-11-07 16:29:26 +02:00
|
|
|
|
|
2022-09-05 18:06:03 +03:00
|
|
|
|
//dammit windows 11...
|
|
|
|
|
/*GlobalFuncs.LogPrint("Loading Font...");
|
|
|
|
|
try
|
2021-11-07 16:29:26 +02:00
|
|
|
|
{
|
2022-09-05 18:06:03 +03:00
|
|
|
|
PrivateFontCollection pfc = new PrivateFontCollection();
|
|
|
|
|
string fontPath = LocalPaths.FixedDataDir + "\\BootstrapperFont.ttf";
|
|
|
|
|
pfc.AddFontFile(fontPath);
|
|
|
|
|
|
|
|
|
|
foreach (var fam in pfc.Families)
|
|
|
|
|
{
|
|
|
|
|
VersionLabel.Font = new Font(fam, VersionLabel.Font.Size);
|
|
|
|
|
LaunchNovetusButton.Font = new Font(fam, VersionLabel.Font.Size);
|
|
|
|
|
}
|
|
|
|
|
GlobalFuncs.LogPrint("Font Loaded");
|
2021-11-07 16:29:26 +02:00
|
|
|
|
}
|
2022-09-05 18:06:03 +03:00
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
GlobalFuncs.LogExceptions(ex);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper();
|
|
|
|
|
CenterToScreen();
|
2021-11-07 16:29:26 +02:00
|
|
|
|
}
|
2022-09-05 18:06:03 +03:00
|
|
|
|
else
|
2021-11-07 16:29:26 +02:00
|
|
|
|
{
|
2022-09-05 18:06:03 +03:00
|
|
|
|
LaunchNovetus();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-04 22:58:40 +03:00
|
|
|
|
|
2022-09-05 18:06:03 +03:00
|
|
|
|
void ReadConfigValues(string cfgpath)
|
|
|
|
|
{
|
2022-09-13 00:26:34 +03:00
|
|
|
|
FileManagement.Config(cfgpath, false);
|
2022-09-05 18:06:03 +03:00
|
|
|
|
LauncherBox.Checked = !GlobalVars.UserConfiguration.BootstrapperShowUI;
|
2021-06-04 22:58:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LaunchNovetusButton_Click(object sender, EventArgs e)
|
2022-09-05 18:06:03 +03:00
|
|
|
|
{
|
|
|
|
|
LaunchNovetus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LaunchNovetus()
|
2021-06-04 22:58:40 +03:00
|
|
|
|
{
|
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName);
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LaunchSDKButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-sdk");
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CMDButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-09-15 20:45:30 +03:00
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmd -cmdmode " + ArgBox.Text);
|
2021-06-04 22:58:40 +03:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CMDHelpButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-09-15 19:46:16 +03:00
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmd -help");
|
2021-06-04 22:58:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DependencyInstallerButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-08-13 22:41:47 +03:00
|
|
|
|
LocalFuncs.LaunchApplicationExt(GlobalPaths.BasePathLauncher, LocalPaths.DependencyLauncherName);
|
2021-06-04 22:58:40 +03:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void URIButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.URIName);
|
|
|
|
|
Close();
|
|
|
|
|
}
|
2022-09-05 18:06:03 +03:00
|
|
|
|
|
|
|
|
|
private void LauncherBox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GlobalVars.UserConfiguration.BootstrapperShowUI = !LauncherBox.Checked;
|
|
|
|
|
}
|
2021-06-04 22:58:40 +03:00
|
|
|
|
}
|
|
|
|
|
}
|