Files
NapCatQQ/.github/tests/windows-launcher/windows-launcher-stub.cs
T
手瓜一十雪 ff9a829e29
macOS QQ runtime / runtime (arm64, macos-15) (push) Canceled after 0s
macOS QQ runtime / runtime (x64, macos-15-intel) (push) Canceled after 0s
Windows launcher / launchers (push) Canceled after 0s
Release Tag / validate-version (push) Canceled after 0s
Release Tag / trigger-release (push) Canceled after 0s
macOS native compatibility / native (arm64, macos-15) (push) Canceled after 0s
macOS native compatibility / native (x64, macos-15-intel) (push) Canceled after 0s
fix(shell): preserve Windows launcher paths and elevation arguments
2026-10-10 11:17:31 +08:00

25 lines
1.2 KiB
C#

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
public class NapCatLauncherAudit {
public static int Main(string[] arguments) {
string name = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName);
if (name == "reg") {
string uninstall = Environment.GetEnvironmentVariable("NAPCAT_AUDIT_UNINSTALL");
if (String.IsNullOrEmpty(uninstall)) return 1;
Console.OutputEncoding = new UTF8Encoding(false);
Console.WriteLine(" UninstallString REG_SZ " + uninstall);
return 0;
}
if (name == "net") return Int32.Parse(Environment.GetEnvironmentVariable("NAPCAT_AUDIT_NET_STATUS"));
string output = Environment.GetEnvironmentVariable("NAPCAT_AUDIT_OUTPUT");
using (StreamWriter writer = new StreamWriter(output, false, new UTF8Encoding(false))) {
writer.WriteLine(name);
foreach (string argument in arguments) writer.WriteLine(Convert.ToBase64String(Encoding.UTF8.GetBytes(argument)));
}
return Int32.Parse(Environment.GetEnvironmentVariable("NAPCAT_AUDIT_BOOT_STATUS") ?? "0");
}
}