Exemplo n.º 1
0
        //---------Remote---------//

        /// Gets the latest version number from the server.
        public static string GetRemoteVersionNumber()
        {
            //Uri latestVersionUri = new Uri(m_oatRemoteVersionFile);
            //WebClient webClient = new WebClient();

            string receivedData = string.Empty;
            ftp    ftpClass     = new ftp();

            try
            {
                //In this case the received data is the version number from server
                //receivedData = webClient.DownloadString(m_oatRemoteVersionFile).Trim();

                receivedData = ftpClass.FtpGetVersionFile(ftp_versionFile, m_oatLocalVersionFile);
            }
            catch (WebException)
            {
                // server or connection is having issues
                System.Windows.MessageBox.Show("Error");
            }

            // Just in case the server returned something other than a valid version number.
            return(versionNumberRegex.IsMatch(receivedData)
                ? receivedData
                : null);
        }
Exemplo n.º 2
0
        //Get new settings file
        public static bool GetSettingsFile()
        {
            //Try to download the file
            try
            {
                //use FTP downloader
                ftp c = new ftp();
                c.FtpGetFile(ftp_bundle + "Additional/OATools_Settings.ini", local_additionalDirectory + "/OATools_Settings.ini");

                return(true);
            }
            catch (Exception)
            {
                //So much can go wrong so just return false
                return(false);
            }
        }
Exemplo n.º 3
0
        //Replace the update apply exe
        public static bool updateTheAdditionalDirectory()
        {
            //Try to download the files
            try
            {
                //use FTP downloader
                ftp c = new ftp();
                c.FtpGetFiles(ftp_bundle + "Additional/", local_additionalDirectory, ".temp");
            }

            catch (Exception)
            {
                //So much can go wrong so just return false
                return(false);
            }
            //The update completed, return true
            return(true);
        }
Exemplo n.º 4
0
        public bool getDNoteFile()
        {
            //Try to download the file
            try
            {
                //use FTP downloader

                ftp c = new ftp();

                c.FtpGetFile(ftp_bundle + "Additional/fsDNote.rfa", local_additionalDirectory + "/fsDNote.rfa");

                return(true);
            }
            catch (Exception)
            {
                //So much can go wrong so just return false
                return(false);
            }
        }
Exemplo n.º 5
0
 //Download REMOTE assembly
 public static bool DownloadRemoteAssembly()
 {
     //clear downloads directory
     if (ClearTheDirectory(local_receivedUpdates))
     {
         //Try to download the files
         try
         {
             //use FTP downloader
             ftp c = new ftp();
             c.FtpGetFiles(ftp_bundleContents, local_receivedUpdates, ".temp");
         }
         catch (Exception)
         {
             //So much can go wrong so just return false
             return(false);
         }
     }
     //The update completed, return true
     return(true);
 }