private void nextButton_Click(object sender, EventArgs e)
        {
            //
            // check Internet connection unless files have already been downloaded
            //
            if (_currentDialog.type == DialogType.DownloadOnly &&
                Directory.GetFiles(Application.StartupPath + "\\deploy").Length < 3)
            {
                if (!InstallationChecks.InternetChecker.CheckConnection())
                {
                    MessageBox.Show(Localizer.GetBestTranslation("DownloadOnly_NoConnectionWarning"), "MediaPortal",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            //
            // check if there's is sufficient hard disk space for installation
            //
            if (_currentDialog.type == DialogType.DBMSSettings || _currentDialog.type == DialogType.TvServerSettings ||
                _currentDialog.type == DialogType.MPSettings)
            {
                // at least 0.5 GB free disk space are required for installation
                const double requiredDiskSpace = 0.5;
                double       actualDiskSpace   =
                    InstallationChecks.DiskSpaceChecker.GetRemainingHardDiskCapacity(_currentDialog.installationPath);

                if (actualDiskSpace < requiredDiskSpace)
                {
                    MessageBox.Show(string.Format(Localizer.GetBestTranslation("DiskSpace_Error"), requiredDiskSpace * 1000),
                                    "MediaPortal", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            if (nextButton.Text == Localizer.GetBestTranslation("MainWindow_buttonClose"))
            {
                //
                // If in download_only mode, start explorer to show downloaded stuff
                //
                if (InstallationProperties.Instance["InstallType"] == "download_only")
                {
                    try
                    {
                        Process process = new Process();
                        process.StartInfo.FileName        = "explorer.exe";
                        process.StartInfo.Arguments       = "/e, " + Application.StartupPath + "\\deploy";
                        process.StartInfo.UseShellExecute = true;
                        process.Start();
                    }
                    // Starting processes might fail - prefer a not opening Explorer instead of a big crash window...
                    catch (Exception)
                    {
                    }
                }
                Close();
                return;
            }
            if (nextButton.Text == Localizer.GetBestTranslation("Install_buttonDownload") ||
                nextButton.Text == Localizer.GetBestTranslation("Install_buttonInstall"))
            {
                nextButton.Enabled = false;
            }
            if (!_currentDialog.SettingsValid())
            {
                return;
            }
            _currentDialog.SetProperties();
            if (InstallationProperties.Instance["language"] != _currentCulture)
            {
                _currentCulture = InstallationProperties.Instance["language"];
                Localizer.SwitchCulture(_currentCulture);
                UpdateUI();
            }
            _currentDialog = _currentDialog.GetNextDialog();
            SwitchDialog(_currentDialog);
            if (!backButton.Visible)
            {
                backButton.Visible = true;
            }
            if (InstallationProperties.Instance["finished"] == "yes")
            {
                backButton.Visible = false;
                nextButton.Enabled = true;
                nextButton.Text    = Localizer.GetBestTranslation("MainWindow_buttonClose");
            }
            if (!_restart && InstallationProperties.Instance["Install_Dialog"] == "yes")
            {
                nextButton.Text = InstallationProperties.Instance["InstallType"] == "download_only"
                            ? Localizer.GetBestTranslation("Install_buttonDownload")
                            : Localizer.GetBestTranslation("Install_buttonInstall");
                InstallationProperties.Instance.Set("Install_Dialog", "no");
            }
        }