Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MessageBox.Show(CmlLib._Test.tstr);

            // 프로그램이 켜졌을때 자바 설치되있는지 확인

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

            if (!java.CheckJavaw())
            {
                var form = new Form2();
                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";
        }
Example #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();
            }
        }