31 lines
778 B
C#
31 lines
778 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace FontPreview;
|
|
|
|
internal static class Program
|
|
{
|
|
[STAThread]
|
|
private static void Main()
|
|
{
|
|
try
|
|
{
|
|
// 被 runas 拉起的安装子进程:只做系统字体注册,不显示主界面
|
|
string[] cmdArgs = Environment.GetCommandLineArgs();
|
|
if (cmdArgs.Length >= 3 && string.Equals(cmdArgs[1], "/install", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
InstallRunner.Run(cmdArgs[2]);
|
|
return;
|
|
}
|
|
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run((Form)(object)new MainForm());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("启动失败,详情:\r\n\r\n" + ex.ToString(), AppInfo.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
}
|