Example #1
0
 public static void InstallUpdateNow(string downloadsURL, string filename, string downloadTo, bool unzip)
 {
     Webdata.DownloadFromWeb(downloadsURL, filename, downloadTo);
     if (unzip)
     {
         UnZip(downloadTo + filename, downloadTo);
     }
 }
Example #2
0
 public static List <string> GetUpdateInfo(string downloadsURL, string versionFile, string resourceDownloadFolder, int startLine)
 {
     if (!Directory.Exists(resourceDownloadFolder))
     {
         Directory.CreateDirectory(resourceDownloadFolder);
     }
     if (!Webdata.DownloadFromWeb(downloadsURL, versionFile, resourceDownloadFolder))
     {
         return(null);
     }
     return(PopulateInfoFromWeb(versionFile, resourceDownloadFolder, startLine));
 }
Example #3
0
        /// <summary>Get update and version information from specified online file - returns a List</summary>
        /// <param name="downloadsURL">URL to download file from</param>
        /// <param name="versionFile">Name of the pipe| delimited version file to download</param>
        /// <param name="resourceDownloadFolder">Folder on the local machine to download the version file to</param>
        /// <param name="startLine">Line number, of the version file, to read the version information from</param>
        /// <returns>List containing the information from the pipe delimited version file</returns>
        public static List <string> GetUpdateInfo(string downloadsURL, string versionFile, string resourceDownloadFolder, int startLine)
        {
            bool updateChecked = false;

            //create download folder if it does not exist
            if (!Directory.Exists(resourceDownloadFolder))
            {
                Directory.CreateDirectory(resourceDownloadFolder);
            }

            //let's try and download update information from the web
            updateChecked = Webdata.DownloadFromWeb(downloadsURL, versionFile, resourceDownloadFolder);

            //if the download of the file was successful
            return(updateChecked ? PopulateInfoFromWeb(versionFile, resourceDownloadFolder, startLine) : null);
        }