Exemplo n.º 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            MessageBox.Show(CmlLib._Test.tstr);

            // Check java runtime

            var java = new CmlLib.Utils.MJava(Minecraft.DefaultPath + "\\runtime");

            if (!java.CheckJavaw())
            {
                var form = new Download_Form();
                form.Show();
                bool iscom = false;

                java.DownloadProgressChanged += (s, v) =>
                {
                    form.ChangeProgress(v.ProgressPercentage);
                };
                java.UnzipCompleted += (t, w) =>
                {
                    form.Close();
                    this.Show();
                    iscom = true;
                };

                java.DownloadJavaAsync();

                while (!iscom)
                {
                    Application.DoEvents();
                }
            }

            Txt_Java.Text = Minecraft.DefaultPath + "\\runtime\\bin\\javaw.exe";
        }
Exemplo n.º 2
0
        public void F_Init()
        {
            try
            {
                Minecraft.DefaultPath = Properties.Settings.Default.mclocation;
                var java = new CmlLib.Utils.MJava(Minecraft.DefaultPath + "\\runtime");
                if (!java.CheckJavaw())
                {
                    var form = new JVDWN();
                    form.Show();
                    bool iscom = false;

                    java.DownloadProgressChanged += (s, v) =>
                    {
                        form.ChangeProgress(v.ProgressPercentage);
                    };
                    java.UnzipCompleted += (t, w) =>
                    {
                        form.Close();
                        this.Show();
                        iscom = true;
                    };

                    java.DownloadJavaAsync();

                    while (!iscom)
                    {
                        Application.DoEvents();
                    }
                }
                MHC.javalocation = Minecraft.DefaultPath + "\\runtime\\bin\\javaw.exe";
            }
            catch (Exception errormessage)
            {
                SphubCore.ErrorWindow ew = new SphubCore.ErrorWindow(errormessage);
                ew.Show();
            }
        }