Ejemplo n.º 1
0
        private void sevenZipLocationTextbox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
        {
            Extraction.sevenZipPath = sevenZipLocationTextbox.Text;

            if (Extraction.CheckLocation(Extraction.sevenZipPath))
            {
                sevenZipSuccessTick.Visibility = Visibility.Visible;
            }
            else
            {
                sevenZipSuccessTick.Visibility = Visibility.Hidden;
            }

            CheckInstallability();
        }
Ejemplo n.º 2
0
        private bool CheckInstallability(bool forceFail = false)
        {
            bool readyForInstall = true;

            if (!Morrowind.CheckLocation(Morrowind.morrowindPath))
            {
                readyForInstall = false;
            }
            if (!Extraction.CheckLocation(Extraction.sevenZipPath))
            {
                readyForInstall = false;
            }
            if (!File.Exists(packageListLocationTextbox.Text))
            {
                readyForInstall = false;
            }

            bool nexusWarnings = false;

            if (packages != null)
            {
                //Update Nexus requirement
                bool reqNex = false;
                foreach (Package p in packages)
                {
                    if (!p.requiresNexus)
                    {
                        continue;
                    }
                    reqNex = true;
                    break;
                }

                nexusWarnings = (reqNex && !(nexusAPIKeyTextBox.Text.Trim().Length > 0)) || forceFail;
            }
            else
            {
                readyForInstall = false;
            }

            nexusWarning.Visibility       = nexusWarnings ? Visibility.Visible : Visibility.Hidden;
            nexusAPIKeyWarning.Visibility = nexusWarnings ? Visibility.Visible : Visibility.Hidden;
            nexusSuccessTick.Visibility   = !nexusWarnings ? Visibility.Visible : Visibility.Hidden;

            installButton.IsEnabled      = !nexusWarnings && readyForInstall;
            installReadyImage.Visibility = !nexusWarnings && readyForInstall ? Visibility.Visible : Visibility.Hidden;
            return(readyForInstall);
        }