Ejemplo n.º 1
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.
        }
Ejemplo n.º 2
0
 private void butInstallStable_Click(object sender,EventArgs e)
 {
     FormUpdateInstallMsg FormUIM=new FormUpdateInstallMsg();
     FormUIM.ShowDialog();
     if(FormUIM.DialogResult!=DialogResult.OK) {
         return;
     }
     string patchName="Setup.exe";
     string fileNameWithVers=stableAvailable;
     fileNameWithVers=fileNameWithVers.Replace("F","");
     fileNameWithVers=fileNameWithVers.Replace(".","_");
     fileNameWithVers="Setup_"+fileNameWithVers+".exe";
     string destDir=ImageStore.GetPreferredAtoZpath();
     string destPath2=null;
     if(destDir==null) {//Not using A to Z folders?
         destDir=Path.GetTempPath();
     }
     else {
         destPath2=ODFileUtils.CombinePaths(destDir,"SetupFiles");
         if(!Directory.Exists(destPath2)) {
             Directory.CreateDirectory(destPath2);
         }
         destPath2=ODFileUtils.CombinePaths(destPath2,fileNameWithVers);
     }
     DownloadInstallPatchFromURI(PrefC.GetString(PrefName.UpdateWebsitePath)+stableAvailableCode+"/"+patchName,//Source URI
         ODFileUtils.CombinePaths(destDir,patchName),
         true,true,
         destPath2);
 }
Ejemplo n.º 3
0
 private void butInstallBeta_Click(object sender,EventArgs e)
 {
     if(!MsgBox.Show(this,MsgBoxButtons.YesNo,"Are you sure you really want to install a beta version?  Do NOT do this unless you are OK with some bugs.  Continue?")){
         return;
     }
     FormUpdateInstallMsg FormUIM=new FormUpdateInstallMsg();
     FormUIM.ShowDialog();
     if(FormUIM.DialogResult!=DialogResult.OK) {
         return;
     }
     string patchName="Setup.exe";
     string fileNameWithVers=betaAvailable;
     fileNameWithVers=fileNameWithVers.Replace("F","");
     fileNameWithVers=fileNameWithVers.Replace(".","_");
     fileNameWithVers="Setup_"+fileNameWithVers+".exe";
     string destDir=ImageStore.GetPreferredAtoZpath();
     string destPath2=null;
     if(destDir==null) {//Not using A to Z folders?
         destDir=Path.GetTempPath();
     }
     else {
         destPath2=ODFileUtils.CombinePaths(destDir,"SetupFiles");
         if(!Directory.Exists(destPath2)) {
             Directory.CreateDirectory(destPath2);
         }
         destPath2=ODFileUtils.CombinePaths(destPath2,fileNameWithVers);
     }
     DownloadInstallPatchFromURI(PrefC.GetString(PrefName.UpdateWebsitePath)+betaAvailableCode+"/"+patchName,//Source URI
         ODFileUtils.CombinePaths(destDir,patchName),
         true,true,
         destPath2);
 }