From dcdee2479e0dc709835e97853bb9db0349210336 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 15 Nov 2018 16:21:13 +0200 Subject: Machine Studio v3.5.70 Stable. Added stable/beta release modes. Handle corrupted log file names. --- .../MachineStudioUpdateService.svc.cs | 41 ++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index 7dff2f203..ce9f7bd93 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -33,6 +33,8 @@ namespace Tango.MachineStudio.UpdateService public bool ForcedUpdate { get; set; } public String FilePath { get; set; } + + public bool IsStable { get; set; } } private static List _pendingUploads; @@ -64,22 +66,37 @@ namespace Tango.MachineStudio.UpdateService if (user != null && user.HasPermission(Permissions.RunMachineStudio) || (request.Email == "ForceUpdate")) { - var latestVersion = db.MachineStudioVersions.ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); + var versions = db.MachineStudioVersions.ToList(); + + var latestVersion = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); Version currentVersion = Version.Parse(request.Version); - bool isForcedUpdate = db.MachineStudioVersions.ToList().Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); + bool isForcedUpdate = versions.Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); - if (latestVersion != null && Version.Parse(latestVersion.Version) > currentVersion) + bool stable_condition = true; + + if (!request.AcceptBetaRelease && !latestVersion.Stable) { - response.IsUpdateAvailable = true; + stable_condition = false; + } - response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); - response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); - response.Password = ConfigurationManager.AppSettings["Password"].ToString(); - response.FilePath = latestVersion.FtpFilePath; - response.Version = latestVersion.Version; - response.Comments = latestVersion.Comments; - response.ForcedUpdate = isForcedUpdate; + String comments = String.Join(Environment.NewLine, versions.OrderBy(x => Version.Parse(x.Version)).Where(x => Version.Parse(x.Version) > currentVersion).Select(x => x.Comments)); + + if (latestVersion != null && Version.Parse(latestVersion.Version) > currentVersion) + { + if (stable_condition) + { + response.IsUpdateAvailable = true; + + response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); + response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); + response.Password = ConfigurationManager.AppSettings["Password"].ToString(); + response.FilePath = latestVersion.FtpFilePath; + response.Version = latestVersion.Version; + response.Comments = latestVersion.Comments; + response.ForcedUpdate = isForcedUpdate; + response.IsStable = latestVersion.Stable; + } } } else @@ -141,6 +158,7 @@ namespace Tango.MachineStudio.UpdateService Token = response.Token, Version = request.Version, FilePath = response.FilePath, + IsStable = request.IsStable, }); } else @@ -184,6 +202,7 @@ namespace Tango.MachineStudio.UpdateService UserGuid = upload.UserGuid, Version = upload.Version, ForceUpdate = upload.ForcedUpdate, + Stable = upload.IsStable, }); db.SaveChanges(); -- cgit v1.3.1 From 30d1e5ac11cb30d3ad4e3501d795f780f55b3686 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 22 Nov 2018 10:43:01 +0200 Subject: Fixed issue with machine studio update service not reporting new updates. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 15400960 -> 15400960 bytes .../Machine Studio Installer.aip | 560 ++++++++++++++++++++- .../Build/Shortcuts/Machine Emulator.lnk | Bin 1455 -> 1471 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1516 -> 1532 bytes .../MachineStudioUpdateService.svc.cs | 41 +- 6 files changed, 575 insertions(+), 26 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 5595da9ae..8a9c198a6 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 9a7a4e361..e8beb7617 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index 9b758eba3..f0de7aead 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -11,10 +11,10 @@ - + - + @@ -29,555 +29,1105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -590,7 +1140,7 @@ - + diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk index dc113fabc..9afe2c39c 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index 120d5e694..9777e06c8 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index ce9f7bd93..2453fd361 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -68,35 +68,34 @@ namespace Tango.MachineStudio.UpdateService { var versions = db.MachineStudioVersions.ToList(); - var latestVersion = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); - Version currentVersion = Version.Parse(request.Version); - - bool isForcedUpdate = versions.Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); - - bool stable_condition = true; + MachineStudioVersion latestVersion = null; - if (!request.AcceptBetaRelease && !latestVersion.Stable) + if (request.AcceptBetaRelease) { - stable_condition = false; + latestVersion = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); + } + else + { + latestVersion = versions.Where(x => x.Stable).OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); } + Version currentVersion = Version.Parse(request.Version); + + bool isForcedUpdate = versions.Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); + String comments = String.Join(Environment.NewLine, versions.OrderBy(x => Version.Parse(x.Version)).Where(x => Version.Parse(x.Version) > currentVersion).Select(x => x.Comments)); if (latestVersion != null && Version.Parse(latestVersion.Version) > currentVersion) { - if (stable_condition) - { - response.IsUpdateAvailable = true; - - response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); - response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); - response.Password = ConfigurationManager.AppSettings["Password"].ToString(); - response.FilePath = latestVersion.FtpFilePath; - response.Version = latestVersion.Version; - response.Comments = latestVersion.Comments; - response.ForcedUpdate = isForcedUpdate; - response.IsStable = latestVersion.Stable; - } + response.IsUpdateAvailable = true; + response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); + response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); + response.Password = ConfigurationManager.AppSettings["Password"].ToString(); + response.FilePath = latestVersion.FtpFilePath; + response.Version = latestVersion.Version; + response.Comments = latestVersion.Comments; + response.ForcedUpdate = isForcedUpdate; + response.IsStable = latestVersion.Stable; } } else -- cgit v1.3.1