Exemple #1
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            project.Zip();
            try
            {
                string exe = Properties.Settings.Default.Path_Executable;
                if (String.IsNullOrEmpty(exe))
                {
                    throw new ExecutionEngineException("No executable specified.");
                }

                this.Enabled = false;
                System.Diagnostics.Process pr = new System.Diagnostics.Process();
                pr.StartInfo.FileName         = exe;
                pr.StartInfo.WorkingDirectory = Path.GetDirectoryName(exe);
                pr.StartInfo.Arguments        = string.Format("\"{0}\"", project.ProjectSource);
                pr.Start();
                while (pr.HasExited == false)
                {
                    Application.DoEvents();
                }
                this.Enabled = true;
                this.Focus();
            }
            catch (ExecutionEngineException)
            {
                MessageBox.Show("Location of LÖVE executable not known. Please tell me where it is (in Tools -> Options).");
            }
            catch (Win32Exception)
            {
                MessageBox.Show(".LÖVE file association not found. Have you installed LÖVE?\n\nYou need to either install LÖVE or tell DEVötiön where it is (in Tools -> Options).", "Can't Handle LÖVE", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }