/// <summary>
        /// Checks for updates.
        /// </summary>
        /// <param name="xmlFilePath">The XML file path.</param>
        /// <param name="currentVersion">The current version.</param>
        /// <param name="pingURL">The ping URL.</param>
        /// <returns></returns>
        public bool CheckForUpdates(string xmlFilePath, Version currentVersion, string pingURL)
        {
            networkUtilities.CheckInternetConnectionState(pingURL);

            try
            {
                if (_globalMethods.GetInternetConnectionState())
                {
                    if (networkUtilities.ExistsOnServer(new Uri(xmlFilePath)))
                    {
                        xmlFileParser.ParseXMLFile(new Uri(xmlFilePath), internalApplicationUpdaterSettingsManager.GetApplicationIdentification());

                        if (IsNewerThan(currentVersion))
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                else
                {
                }
            }
            catch (Exception e)
            {
                if (_globalMethods.GetIsTargetPlatformSupported())
                {
                    ExceptionHandler.CaptureException(e, "Error Thrown", MessageBoxButtons.OK, MessageBoxIcon.Error, "UpdaterLogic", "CheckForUpdates(string xmlFilePath, Version currentVersion, string pingURL)");
                }
                else
                {
                }

                return(false);
            }

            return(false);
        }
        /// <summary>
        /// Checks for updates.
        /// </summary>
        /// <param name="xmlFilePath">The XML file path.</param>
        /// <param name="currentVersion">The current version.</param>
        /// <param name="pingURL">The ping URL.</param>
        /// <returns></returns>
        public bool CheckForUpdates(string xmlFilePath, Version currentVersion, string pingURL)
        {
            networkUtilities.CheckInternetConnectionState(pingURL);

            try
            {
                if (_globalMethods.GetInternetConnectionState())
                {
                    if (networkUtilities.ExistsOnServer(new Uri(xmlFilePath)))
                    {
                        xmlFileParser.ParseXMLFile(new Uri(xmlFilePath), internalApplicationUpdaterSettingsManager.GetApplicationIdentification());

                        if (IsNewerThan(currentVersion))
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                else
                {
                }
            }
            catch (Exception e)
            {
                if (_globalMethods.GetIsTargetPlatformSupported())
                {
                    _exceptionHandler.ShowException($"Error: { e.Message }", true, false, false, false, false, null, null, "An Error has Occurred", MessageBoxButtons.OK, MessageBoxDefaultButton.Button1, MessageBoxIcon.Error);
                }
                else
                {
                }

                return(false);
            }

            return(false);
        }
Esempio n. 3
0
        /// <summary>
        /// Are the internal application updater settings default.
        /// </summary>
        /// <returns></returns>
        public static bool AreInternalApplicationUpdaterSettingsDefault()
        {
            InternalApplicationUpdaterSettingsManager manager = new InternalApplicationUpdaterSettingsManager();

            if (manager.GetAlwaysUsePrompt() == false && manager.GetAlwaysUseUACElevation() == false && manager.GetBetaFlag() == false && manager.GetDisableAutomaticUpdates() == false && manager.GetDateOfLastCheck() == DateTime.Now && manager.GetDateOfLastUpdateInstallation() == DateTime.Now && manager.GetDateOfNextCheck() == DateTime.Now && manager.GetApplicationIdentification() == string.Empty && manager.GetApplicationName() == string.Empty && manager.GetCurrentApplicationVersion() == string.Empty && manager.GetDestinationDownloadPath() == string.Empty && manager.GetVersionXMLFileURL() == string.Empty)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }