2024-05-15 19:29:07 +03:00
|
|
|
|
using Novetus.Core;
|
2021-11-13 22:56:56 +02:00
|
|
|
|
using System;
|
2021-06-04 22:58:40 +03:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Text;
|
2023-04-14 19:00:12 +03:00
|
|
|
|
using System.IO;
|
2021-06-04 22:58:40 +03:00
|
|
|
|
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)
|
|
|
|
|
{
|
2023-12-12 01:47:03 +02:00
|
|
|
|
FileManagement.ReadInfoFile(LocalPaths.InfoPath,
|
|
|
|
|
LocalPaths.VersionTermList,
|
|
|
|
|
LocalPaths.LauncherPath);
|
2023-05-23 08:48:25 +03:00
|
|
|
|
|
|
|
|
|
if (File.Exists(LocalPaths.ConfigPath))
|
|
|
|
|
{
|
2023-04-14 19:00:12 +03:00
|
|
|
|
ReadConfigValues(LocalPaths.ConfigPath);
|
|
|
|
|
}
|
2021-08-13 22:41:47 +03:00
|
|
|
|
|
2023-04-22 01:06:49 +03:00
|
|
|
|
if (GlobalVars.UserConfiguration.ReadSettingBool("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);
|
|
|
|
|
}*/
|
|
|
|
|
|
2023-04-14 19:00:12 +03:00
|
|
|
|
if (File.Exists(LocalPaths.ConfigPath))
|
|
|
|
|
{
|
|
|
|
|
VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper();
|
|
|
|
|
}
|
2022-09-05 18:06:03 +03:00
|
|
|
|
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)
|
|
|
|
|
{
|
2023-04-22 01:06:49 +03:00
|
|
|
|
LauncherBox.Checked = !GlobalVars.UserConfiguration.ReadSettingBool("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()
|
2022-09-18 17:59:32 +03:00
|
|
|
|
{
|
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-nocmd");
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LaunchNovetusWithConsoleButton_Click(object sender, EventArgs e)
|
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)
|
|
|
|
|
{
|
2023-05-19 03:25:05 +03:00
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly " + ArgBox.Text);
|
2021-06-04 22:58:40 +03:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CMDHelpButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-09-18 17:59:32 +03:00
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly -help");
|
2021-06-04 22:58:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DependencyInstallerButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-05-15 19:29:07 +03:00
|
|
|
|
LocalFuncs.LaunchApplicationExt(GlobalPaths.BasePath, 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)
|
|
|
|
|
{
|
2023-04-22 01:06:49 +03:00
|
|
|
|
GlobalVars.UserConfiguration.SaveSettingBool("BootstrapperShowUI", !LauncherBox.Checked);
|
2022-09-05 18:06:03 +03:00
|
|
|
|
}
|
2023-05-19 03:25:05 +03:00
|
|
|
|
|
|
|
|
|
private void CMDBarebonesButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly " + ArgBox.Text);
|
|
|
|
|
}
|
2021-06-04 22:58:40 +03:00
|
|
|
|
}
|
|
|
|
|
}
|