static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); Thread.GetDomain().UnhandledException += new UnhandledExceptionEventHandler(Application_UnhandledException); try { var checker = new CubePdf.Settings.UpdateChecker(@"Software\CubeSoft\CubePDF"); checker.ProductName = "cubepdf"; checker.CheckInterval = 1; // [day] if (args.Length > 0 && args[0] == "install") { var installer = new CubePdf.Settings.InstallChecker(args); installer.Notify(); checker.Notify(); } else { var response = checker.GetResponse(); if (response != null && response.ContainsKey("UPDATE") && response["UPDATE"] == "1" && response.ContainsKey("MESSAGE") && response.ContainsKey("URL")) { new DummyForm(response); Application.Run(); } } } catch (Exception err) { Trace.TraceError(err.ToString()); } finally { System.Environment.Exit(0); } }