Takes a URL and tries to find the newest version of the software that exists online.
Exemplo n.º 1
0
        /// <summary>
        /// If the user has requested that we find the latest version of the software,
        /// this will return the regular expression of the software's URL filled
        /// in with the latest software, if possible.
        /// </summary>
        /// <returns></returns>
        public string FindLatestUrl()
        {
            RemoteVersionChecker checker       = new RemoteVersionChecker();
            List <int>           versionString = null;

            // If we need to, build the download URL by going out there and finding the latest version
            if (options.DownloadLatestVersion && this.version == null)
            {
                // If original version is null, we couldn't aprse anything from the download URL
                if (this.originalVersion != null)
                {
                    versionString    = checker.LatestVersion(this.parsedDownloadUrl, this.originalVersion);
                    this.downloadUrl = RemoteVersionChecker.FillInUrl(this.parsedDownloadUrl, versionString);

                    // Update our version
                    for (int i = 0; i < versionString.Count; i++)
                    {
                        // Avoid adding a period onto the last part of the string
                        this.version = this.version + i + ((i == versionString.Count - 1) ? "" : ".");
                    }
                }
            }

            return(this.downloadUrl);
        }
Exemplo n.º 2
0
        /// <summary>
        /// If the user has requested that we find the latest version of the software,
        /// this will return the regular expression of the software's URL filled
        /// in with the latest software, if possible.
        /// </summary>
        /// <returns></returns>
        public string FindLatestUrl()
        {
            RemoteVersionChecker checker = new RemoteVersionChecker();
            List<int> versionString = null;

            // If we need to, build the download URL by going out there and finding the latest version
            if (options.DownloadLatestVersion && this.version == null)
            {
                // If original version is null, we couldn't aprse anything from the download URL
                if (this.originalVersion!=null)
                {   
                versionString = checker.LatestVersion(this.parsedDownloadUrl, this.originalVersion);
                this.downloadUrl = RemoteVersionChecker.FillInUrl(this.parsedDownloadUrl, versionString);

                // Update our version
                for (int i = 0; i < versionString.Count; i++)
                    // Avoid adding a period onto the last part of the string
                    this.version = this.version + i + ((i == versionString.Count - 1) ? "" : ".");
                }
            }
            
            return this.downloadUrl;
        }