Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public Updater()
        {
            InitializeComponent();
            textBoxX1.Text = "Checking X360...";
            UpdateReturn xReturn = XAbout.CheckForUpdate();

            if (!xReturn.ServerReached)
            {
                textBoxX2.Text = "X360: Error";
            }
            else if (xReturn.NeedsUpdate)
            {
                textBoxX2.Text       = "X360: Not Up-To-Date";
                textBoxX4.Text      += "\r\nX360: " + xReturn.UpdateNotes + "\r\n";
                buttonX1.Enabled     =
                    buttonX2.Enabled = true;
            }
            else
            {
                textBoxX2.Text = "X360: Current";
            }
            textBoxX1.Text = "Checking Le Fluffie...";
            try
            {
                StreamReader x       = X360.Other.VariousFunctions.GetWebPageResponse("http://skunkiebutt.com/ProductCheck.php?product=Le Fluffie&command=read");
                string       version = x.ReadLine();
                if ((version != Application.ProductVersion))
                {
                    textBoxX3.Text       = "Le Fluffie: Not Up-To-Date";
                    UpdateLoc            = x.ReadLine();
                    textBoxX4.Text      += "\r\nLe Fluffie: " + x.ReadLine();
                    buttonX1.Enabled     =
                        buttonX2.Enabled = true;
                }
                else
                {
                    textBoxX3.Text = "Le Fluffie: Current";
                }
                x.Dispose();
            }
            catch { textBoxX2.Text = "Le Fluffie: Error"; }
            textBoxX1.Text = "Status: Idle...";
        }