WikiFunctions.Updater.UpdateFunc C# (CSharp) Method

UpdateFunc() private static method

Do the actual checking for enabledness etc
private static UpdateFunc ( ) : void
return void
        private static void UpdateFunc()
        {
            try
            {
                string text =
                    Tools.GetHTML(
                        "https://en.wikipedia.org/w/index.php?title=Wikipedia:AutoWikiBrowser/CheckPage/Version&action=raw");
                GlobalVersionPage = text;

                int awbCurrentVersion =
                    StringToVersion(Regex.Match(text, @"<!-- Current version: (.*?) -->").Groups[1].Value);

                int awbNewestVersion =
                    StringToVersion(Regex.Match(text, @"<!-- Newest version: (.*?) -->").Groups[1].Value);

                if ((awbCurrentVersion > 4000) || (awbNewestVersion > 4000))
                {
                    int updaterVersion =
                        StringToVersion(Regex.Match(text, @"<!-- Updater version: (.*?) -->").Groups[1].Value);

                    FileVersionInfo awbVersionInfo =
                        FileVersionInfo.GetVersionInfo(AWBDirectory + "AutoWikiBrowser.exe");
                    int awbFileVersion = StringToVersion(awbVersionInfo.FileVersion);

                    Result = AWBEnabledStatus.Disabled; //Disabled till proven enabled

                    if (awbFileVersion < awbCurrentVersion)
                        return;

                    foreach (Match m in EnabledVersions.Matches(text))
                    {
                        if (StringToVersion(m.Groups[1].Value) == awbFileVersion)
                        {
                            Result = AWBEnabledStatus.Enabled;
                            break;
                        }
                    }

                    if (Result == AWBEnabledStatus.Disabled)
                        return;

                    if ((updaterVersion > 1400) &&
                        (updaterVersion >
                         StringToVersion(FileVersionInfo.GetVersionInfo(AWBDirectory + "AWBUpdater.exe").FileVersion)))
                    {
                        Result |= AWBEnabledStatus.UpdaterUpdate;
                    }

                    if ((awbFileVersion >= awbCurrentVersion) && (awbFileVersion < awbNewestVersion))
                    {
                        Result |= AWBEnabledStatus.OptionalUpdate;
                    }
                }
            }
            catch
            {
                Result = AWBEnabledStatus.Error;
            }
        }