diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-26 13:12:10 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-26 13:12:10 +0200 |
| commit | c338e69e9b60ddb71102a6b11058912dd06d5018 (patch) | |
| tree | 16d1445dd6028a4419eb1769affd757a5c1a05fc /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | |
| parent | 03180d26af65c24822cf5ffd44a347db7394d3b2 (diff) | |
| download | Tango-c338e69e9b60ddb71102a6b11058912dd06d5018.tar.gz Tango-c338e69e9b60ddb71102a6b11058912dd06d5018.zip | |
Import job & update completed with dialogs!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index d3757e50d..b4780887b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -2,6 +2,7 @@ using Microsoft.WindowsAzure.Storage.Blob; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; @@ -479,6 +480,33 @@ namespace Tango.PPC.Common.MachineUpdate }); } + /// <summary> + /// Gets the update package file information. + /// </summary> + /// <param name="filePath">The file path.</param> + /// <returns></returns> + public Task<UpdatePackageFile> GetUpdatePackageFileInfo(string filePath) + { + return Task.Factory.StartNew<UpdatePackageFile>(() => + { + UpdatePackageFile file = new UpdatePackageFile(); + var tempFolder = TemporaryManager.CreateFolder(); + + using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile(filePath)) + { + var appEntry = zip.Entries.SingleOrDefault(x => x.FileName == "Tango.PPC.UI.exe"); + appEntry.Extract(tempFolder); + } + + FileVersionInfo info = FileVersionInfo.GetVersionInfo(Path.Combine(tempFolder, "Tango.PPC.UI.exe")); + file.Version = Version.Parse(info.ProductVersion); + + tempFolder.Delete(); + + return file; + }); + } + #endregion } } |
