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

@@ -6,7 +6,7 @@ public static class Extensions
{
public static bool IsSide(this Side @this, Side side)
{
return @this.HasFlag(side) || side.HasFlag(@this);
return @this.HasFlag(side);
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>icons8_download_from_ftp.ico</ApplicationIcon>

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)