Example #1
0
        public MainForm()
        {
            CheckForIllegalCrossThreadCalls = false;
            string proc = Process.GetCurrentProcess().ProcessName;
            int    id   = Process.GetCurrentProcess().Id;

            Process[] lst = Process.GetProcesses();
            foreach (Process p in lst)
            {
                if (p.ProcessName != proc || p.Id == id)
                {
                    continue;
                }
                MessageBox.Show("This program is already open");
                Process.GetCurrentProcess().Kill();
                return;
            }
            InitializeComponent();
            VariousFunctions.DeleteFile(Application.StartupPath + "/LFLiveUpdater.exe");
            bool   devmode = AssemblyFunctions.GrabParentProcessName() == "devenv";
            Thread y       = new Thread(new ParameterizedThreadStart(upd));

            y.Start(devmode);
            Thread x = new Thread(new ParameterizedThreadStart(startss));

            x.Start(devmode);
            VariousFunctions.DeleteTempFiles();
            Thread z = new Thread(new ThreadStart(readrss));

            z.Start();
            PublicKV = new RSAParams(Application.StartupPath + "/KV.bin");
            if (!PublicKV.Valid)
            {
                MessageBox.Show("Cannot load KV");
                Process.GetCurrentProcess().Kill();
                return;
            }
            XAbout.WriteLegalLocally();
            while (x.IsAlive)
            {
                Application.DoEvents();
            }
            Show();
            while (y.IsAlive)
            {
                Application.DoEvents();
            }
            Enabled = true;
            Select();
            Focus();
            if (!devmode)
            {
                updr.Dispose();
                updr = null;
            }
            checkForUpdatesToolStripMenuItem.Enabled = true;
        }
Example #2
0
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     updr = new Updater();
     updr.ShowDialog();
     updr.Dispose();
 }
Example #3
0
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     updr = new Updater();
     updr.ShowDialog();
     updr.Dispose();
 }