Example #1
0
        public static int Main(string[] args)
        {
            if (args != null && args.Length > 0)
            {
                CertUtil.Open(OpenFlags.ReadWrite);
                bool ok = false;
                switch (args[0])
                {
                case "--install-cert":
                    ok = CertUtil.InstallCertificate(Variables.CertUrl, Variables.CertThumb).GetAwaiter().GetResult();
                    break;

                case "--uninstall-cert":
                    ok = CertUtil.UninstallCertificate(Variables.CertThumb);
                    break;
                }
                CertUtil.Close();
                return(ok ? 0 : -1);
            }
            else
            {
                if (Environment.OSVersion.Version >= new Version(10, 0, 18362, 0))
                {
                    UxTheme.SetPreferredAppMode(1);
                }
                var app = new App();
                app.InitializeComponent();
                app.Run();
                return(0);
            }
        }
Example #2
0
 private void Application_Startup(object sender, StartupEventArgs e) => CertUtil.Open();