Skip to content

Commit 98e68a0

Browse files
committed
隐藏 CommandInstaller 的控制台窗口
1 parent 767419e commit 98e68a0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

FluentLauncher.CommandLineInstaller/FluentLauncher.CommandLineInstaller.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
4+
<OutputType>WinExe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

FluentLauncher.CommandLineInstaller/InstallScripts.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ public static async Task InstallPackage(string packagePath, string[] dependencyP
7171

7272
static async Task CheckPowerShellCommand(string commandName)
7373
{
74-
using var process = Process.Start(new ProcessStartInfo("powershell", $"Get-Command {commandName}"))
75-
?? throw new InvalidOperationException("couldn't start powershell process");
74+
using var process = Process.Start(new ProcessStartInfo("powershell", $"Get-Command {commandName}")
75+
{
76+
CreateNoWindow = true,
77+
}) ?? throw new InvalidOperationException("couldn't start powershell process");
7678

7779
await process.WaitForExitAsync();
7880

0 commit comments

Comments
 (0)