show console on cmd

This commit is contained in:
2024-08-09 15:37:36 +02:00
parent a30893e04c
commit ef314ac227
3 changed files with 12 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
using ModpackUpdater.Model;
using Newtonsoft.Json;
using Pilz.Configuration;
using System.Runtime.InteropServices;
using Telerik.WinControls;
namespace ModpackUpdater;
@@ -12,6 +13,12 @@ public static class Program
public static ISettings Settings => settingsManager.Instance;
[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static Program()
{
settingsManager = new(GetSettingsPath(2), true);
@@ -25,7 +32,10 @@ public static class Program
if (options.NoUi)
InstallWithoutGui(options.UpdateOptions, options.Silent);
else
{
ShowWindow(GetConsoleWindow(), 0);
RunApp(options.UpdateOptions);
}
}
private static void RunApp(UpdateCheckOptionsAdv updateOptions)