show console on cmd
This commit is contained in:
@@ -6,7 +6,7 @@ public static class Extensions
|
|||||||
{
|
{
|
||||||
public static bool IsSide(this Side @this, Side side)
|
public static bool IsSide(this Side @this, Side side)
|
||||||
{
|
{
|
||||||
return @this.HasFlag(side) || side.HasFlag(@this);
|
return @this.HasFlag(side);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ApplicationIcon>icons8_download_from_ftp.ico</ApplicationIcon>
|
<ApplicationIcon>icons8_download_from_ftp.ico</ApplicationIcon>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using ModpackUpdater.Model;
|
using ModpackUpdater.Model;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Pilz.Configuration;
|
using Pilz.Configuration;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Telerik.WinControls;
|
using Telerik.WinControls;
|
||||||
|
|
||||||
namespace ModpackUpdater;
|
namespace ModpackUpdater;
|
||||||
@@ -12,6 +13,12 @@ public static class Program
|
|||||||
|
|
||||||
public static ISettings Settings => settingsManager.Instance;
|
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()
|
static Program()
|
||||||
{
|
{
|
||||||
settingsManager = new(GetSettingsPath(2), true);
|
settingsManager = new(GetSettingsPath(2), true);
|
||||||
@@ -25,7 +32,10 @@ public static class Program
|
|||||||
if (options.NoUi)
|
if (options.NoUi)
|
||||||
InstallWithoutGui(options.UpdateOptions, options.Silent);
|
InstallWithoutGui(options.UpdateOptions, options.Silent);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
ShowWindow(GetConsoleWindow(), 0);
|
||||||
RunApp(options.UpdateOptions);
|
RunApp(options.UpdateOptions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RunApp(UpdateCheckOptionsAdv updateOptions)
|
private static void RunApp(UpdateCheckOptionsAdv updateOptions)
|
||||||
|
|||||||
Reference in New Issue
Block a user