aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-01-27 09:19:11 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-01-27 09:19:11 +0200
commitddda6089bff56e80703c8d2dce297919edc58bf1 (patch)
tree7702c5cf169124d522eacc7f1a9e0878373baedd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
parent1d4d327571d4c0c9f4e17411551bd4dae1e2aed0 (diff)
parentbf2f3245339b9fd9148a2ad25b5ba3320e970cc1 (diff)
downloadTango-ddda6089bff56e80703c8d2dce297919edc58bf1.tar.gz
Tango-ddda6089bff56e80703c8d2dce297919edc58bf1.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs67
1 files changed, 34 insertions, 33 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
index 4a94322fb..160041b5f 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
@@ -173,12 +173,13 @@ namespace Tango.MachineStudio.UI.ViewModels
DownloadLatestVersionResponse response = await _machineStudioWebClient.DownloadLatestVersion(new DownloadLatestVersionRequest()
{
-
+
});
_updateInfo = new CheckForUpdatesResponse();
_updateInfo.BlobAddress = response.BlobAddress;
_updateInfo.Version = response.Version;
+ _updateInfo.CdnAddress = response.CdnAddress;
LatestVersion = _updateInfo.Version;
StartUpdate();
@@ -270,9 +271,9 @@ namespace Tango.MachineStudio.UI.ViewModels
{
logManager.Log("Creating temporary file " + tempFile);
- using (StorageBlobDownloader downloader = new StorageBlobDownloader(_updateInfo.BlobAddress, tempFile.Path))
+ using (AutoFileDownloader downloader = new AutoFileDownloader(_updateInfo.BlobAddress, _updateInfo.CdnAddress, tempFile.Path))
{
- downloader.Progress += (x, e) =>
+ downloader.Progress += (x, e) =>
{
InvokeUINow(() =>
{
@@ -326,40 +327,40 @@ namespace Tango.MachineStudio.UI.ViewModels
}
}
- try
- {
- LogManager.Log("Backing up current version...");
- CurrentUpdateFile = "Backing up current version...";
+ //try
+ //{
+ // LogManager.Log("Backing up current version...");
+ // CurrentUpdateFile = "Backing up current version...";
- String rollbackFolder = GetRollbackFolder();
- Directory.CreateDirectory(rollbackFolder);
+ // String rollbackFolder = GetRollbackFolder();
+ // Directory.CreateDirectory(rollbackFolder);
- String backFile = GetRollbackFile();
+ // String backFile = GetRollbackFile();
- if (File.Exists(backFile))
- {
- File.Delete(backFile);
- }
+ // if (File.Exists(backFile))
+ // {
+ // File.Delete(backFile);
+ // }
- using (ZipFile backZip = new ZipFile(backFile))
- {
- int currentEntry = 0;
+ // using (ZipFile backZip = new ZipFile(backFile))
+ // {
+ // int currentEntry = 0;
- backZip.SaveProgress += (_, e) =>
- {
- UpdateProgress = ((double)(currentEntry++) / (double)backZip.Entries.Count) * 100d;
- };
+ // backZip.SaveProgress += (_, e) =>
+ // {
+ // UpdateProgress = ((double)(currentEntry++) / (double)backZip.Entries.Count) * 100d;
+ // };
- backZip.Password = "Aa123456";
- backZip.AddDirectory(_appPath);
- backZip.Save();
- }
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Could not construct rollback.");
- _notification.ShowWarning("Update center has failed to construct a rollback point for the current version. Version rollback will not be available.");
- }
+ // backZip.Password = "Aa123456";
+ // backZip.AddDirectory(_appPath);
+ // backZip.Save();
+ // }
+ //}
+ //catch (Exception ex)
+ //{
+ // LogManager.Log(ex, "Could not construct rollback.");
+ // _notification.ShowWarning("Update center has failed to construct a rollback point for the current version. Version rollback will not be available.");
+ //}
TangoIOC.Default.GetInstance<MainViewVM>().DisableCheckForUpdates = true;
Status = UpdateStatus.UpdateCompleted;
@@ -385,8 +386,8 @@ namespace Tango.MachineStudio.UI.ViewModels
{
try
{
- LogManager.Log("Clearing EF model store...");
- ObservablesContext.ClearModelStore();
+ //LogManager.Log("Clearing EF model store...");
+ //ObservablesContext.ClearModelStore();
Process p = new Process();