static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (IsAdmin() == false) { MessagerForm f = new MessagerForm(null, MessagerType.Info, noadminmsg); f.ShowDialog(); Application.Exit(); } else { if (IsSevenOrHigher() == true) { string resource = "Cloning.Newtonsoft.Json.dll"; EmbeddedAssembly.Load(resource, "Newtonsoft.Json.dll"); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); // load settings, if there is no settings, load defaults Options.LoadSettings(); Application.Run(new MainForm()); } else { MessagerForm f = new MessagerForm(null, MessagerType.Info, unsupportedmsg); f.ShowDialog(); Application.Exit(); } } }
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { return(EmbeddedAssembly.Get(args.Name)); }