예제 #1
0
        private void butDownload_Click(object sender, System.EventArgs e)
        {
            if (IsDynamicMode())
            {
                return;
            }
            string patchName = "Setup.exe";
            string destDir   = ImageStore.GetPreferredAtoZpath();

            if (destDir == null || CloudStorage.IsCloudStorage)
            {
                destDir = PrefC.GetTempFolderPath();
            }
            PrefL.DownloadInstallPatchFromURI(textWebsitePath.Text + textUpdateCode.Text + "/" + patchName,     //Source URI
                                              ODFileUtils.CombinePaths(destDir, patchName), true, false, null); //Local destination file.
        }
예제 #2
0
        private void DownloadInstallPatchForVersion(string version, string updateCode, bool showFormUpdateInstallMsg)
        {
            if (IsDynamicMode())
            {
                return;
            }
            if (showFormUpdateInstallMsg)
            {
                FormUpdateInstallMsg FormUIM = new FormUpdateInstallMsg();
                FormUIM.ShowDialog();
                if (FormUIM.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            string patchName        = "Setup.exe";
            string fileNameWithVers = version;                       //6.9.23F

            fileNameWithVers = fileNameWithVers.Replace("F", "");    //6.9.23
            fileNameWithVers = fileNameWithVers.Replace(".", "_");   //6_9_23
            fileNameWithVers = "Setup_" + fileNameWithVers + ".exe"; //Setup_6_9_23.exe
            string destDir   = ImageStore.GetPreferredAtoZpath();
            string destPath2 = null;

            if (destDir == null)           //Not using A to Z folders?
            {
                destDir = PrefC.GetTempFolderPath();
            }
            else              //using A to Z folders.
            {
                destPath2 = ODFileUtils.CombinePaths(destDir, "SetupFiles");
                if (PrefC.AtoZfolderUsed == DataStorageType.LocalAtoZ && !Directory.Exists(destPath2))
                {
                    Directory.CreateDirectory(destPath2);
                }
                else if (CloudStorage.IsCloudStorage)
                {
                    destDir = PrefC.GetTempFolderPath();                  //Cloud needs it to be downloaded to a local temp folder
                }
                destPath2 = ODFileUtils.CombinePaths(destPath2, fileNameWithVers);
            }
            PrefL.DownloadInstallPatchFromURI(PrefC.GetString(PrefName.UpdateWebsitePath) + updateCode + "/" + patchName, //Source URI
                                              ODFileUtils.CombinePaths(destDir, patchName),                               //Local destination file.
                                              true, true,
                                              destPath2);                                                                 //second destination file.  Might be null.
        }