using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace MioStar_GUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            /*
             * Check if the following files exist :
             * - RulesFile
             * - DLLInjector.exe 
             * - MioStar.dll exist.
             * - nss3.dll
             * 
             */

            if (! File.Exists("DLLInjector.exe"))
                printFileErrorMsg("DLLInjector.exe");
            else if (! File.Exists("MioStar.dll"))
                printFileErrorMsg("MioStar.dll");
            else
            {

                /*
                 * Run application
                 * 
                 */
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MioStarGUI());
            }
        }


        static void printFileErrorMsg(string pMissingFile)
        {
            MessageBox.Show("\"" + pMissingFile + "\" does not exist!\nPut a copy of it in \"" + Directory.GetCurrentDirectory() + "\\\" !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}
