AvalonPatch.AvalonPatch.AvalonPatch C# (CSharp) Method

AvalonPatch() public method

public AvalonPatch ( ) : System
return System
        public AvalonPatch()
        {
            InitializeComponent();

            if (SkinInfo.mpPaths.sMPbaseDir == null)
            {
                DialogResult result = MessageBox.Show("MediaPortal is not Installed on this system or Avalon is NOT configured as your default skin. - Please install MediaPortal/Avalon or set Avalon as your default skin before running this patch.",
                      "Patch Error............",
                      MessageBoxButtons.OK,
                      MessageBoxIcon.Error);

                if (result == DialogResult.OK)
                {
                    Environment.Exit(0);
                }
            }

            foreach (string arg in Environment.GetCommandLineArgs())
            {
                // Run unattended - This will run the program minimised and exit
                if (arg.ToLower().Contains("unattended") || arg.ToLower().StartsWith("/s"))
                {
                    unattendedInatall = true;
                    btInstallPatch.Enabled = false;
                    this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
                }
                else
                    this.WindowState = System.Windows.Forms.FormWindowState.Normal;

                // Do we restart MediaPortal after the update
                if (arg.ToLower().Contains("restartmp"))
                {
                    restartMediaPortal = true;
                }
                // Do we restart Configuration after the update
                if (arg.ToLower().Contains("restartconfiguration"))
                {
                    restartConfiguration = true;
                }
            }
        }