From e112866a2cf44ddeb5b40e8ffc84614ecfe6abdf Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 25 Feb 2019 18:18:35 +0200 Subject: Implemented auto installer release for machine studio and PPC. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Machine Studio Installer.aip | 109 ++------------ .../PPC Installer-cache/cacheIndex.txt | Bin 52 -> 52 bytes .../part2/PPC Installer v1.0.31.cab | Bin 0 -> 36704809 bytes .../PPC Installer-cache/part2/output-info.ini | Bin 0 -> 93688 bytes .../part4/PPC Installer v1.0.31.cab | Bin 42202264 -> 0 bytes .../PPC Installer-cache/part4/output-info.ini | Bin 93946 -> 0 bytes .../Advanced Installer Projects/PPC Installer.aip | 101 ++++++++++++- .../Build/Shortcuts/Machine Emulator.lnk | Bin 1445 -> 1471 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1516 -> 1532 bytes .../Build/Shortcuts/Proto Compiler GUI.lnk | Bin 1444 -> 1464 bytes .../Publish/MachineStudioPublisher.cs | 42 +++++- .../Publish/PublishOptions.cs | 8 ++ .../Tango.MachineStudio.Common.csproj | 6 +- .../Web/UploadVersionRequest.cs | 2 + .../Web/UploadVersionResponse.cs | 2 + .../MainWindow.xaml | 14 +- .../MainWindowVM.cs | 4 +- .../PublisherSettings.cs | 20 +++ .../Tango.MachineStudio.Publisher.UI.csproj | 3 +- .../PPC/Tango.PPC.Common/Publish/PPCPublisher.cs | 43 +++++- .../PPC/Tango.PPC.Common/Publish/PublishOptions.cs | 24 ++-- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 6 +- .../Tango.PPC.Common/Web/UploadVersionRequest.cs | 2 + .../Tango.PPC.Common/Web/UploadVersionResponse.cs | 2 + .../PPC/Tango.PPC.Publisher.UI/MainWindow.xaml | 160 +++++++++++---------- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.BL/DTO/MachineStudioVersionDTOBase.cs | 8 ++ .../Tango.BL/DTO/TangoVersionDTOBase.cs | 8 ++ .../Tango.BL/Entities/MachineStudioVersionBase.cs | 38 +++++ .../Tango.BL/Entities/TangoVersionBase.cs | 38 +++++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 2 +- .../Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.Designer.cs | 2 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 6 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 140 +++++++++--------- .../Tango.DAL.Remote/DB/TANGO_VERSIONS.cs | 1 + .../Controllers/MachineStudioController.cs | 21 ++- .../Controllers/PPCController.cs | 23 ++- .../Models/MachineStudioPendingUpload.cs | 4 +- .../Models/PPCPendingUpload.cs | 2 + 42 files changed, 563 insertions(+), 281 deletions(-) create mode 100644 Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/PPC Installer v1.0.31.cab create mode 100644 Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/output-info.ini delete mode 100644 Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/PPC Installer v1.0.31.cab delete mode 100644 Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/output-info.ini create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/PublisherSettings.cs diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index e400bce89..5b4e7faf4 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 fc6f572ca..5968b617e 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 2937817c5..3ee4d0f15 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -18,7 +18,7 @@ - + @@ -66,17 +66,9 @@ - - - - - - - - @@ -106,13 +98,13 @@ - + @@ -122,9 +114,7 @@ - - @@ -133,7 +123,6 @@ - @@ -141,11 +130,8 @@ - - - @@ -157,18 +143,13 @@ - - - - - @@ -195,7 +176,6 @@ - @@ -212,23 +192,15 @@ - - - - - - - - @@ -236,26 +208,21 @@ - - - - - - + @@ -307,26 +274,19 @@ - - - - - - - + - - + @@ -354,7 +314,7 @@ - + @@ -369,21 +329,12 @@ - - - - - - - - - @@ -430,7 +381,6 @@ - @@ -439,7 +389,6 @@ - @@ -464,9 +413,7 @@ - - @@ -475,7 +422,6 @@ - @@ -485,11 +431,8 @@ - - - @@ -501,18 +444,13 @@ - - - - - @@ -547,7 +485,6 @@ - @@ -564,24 +501,16 @@ - - - - - - - - @@ -589,12 +518,10 @@ - - @@ -603,15 +530,13 @@ - - - - + + @@ -745,32 +670,18 @@ - - - - - - - - - - - - - - @@ -788,7 +699,7 @@ - + @@ -864,6 +775,8 @@ + + diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt index 6d87e9201..a603ff06b 100644 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/PPC Installer v1.0.31.cab b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/PPC Installer v1.0.31.cab new file mode 100644 index 000000000..d61184528 Binary files /dev/null and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/PPC Installer v1.0.31.cab differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/output-info.ini b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/output-info.ini new file mode 100644 index 000000000..4843c205f Binary files /dev/null and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part2/output-info.ini differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/PPC Installer v1.0.31.cab b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/PPC Installer v1.0.31.cab deleted file mode 100644 index 472742398..000000000 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/PPC Installer v1.0.31.cab and /dev/null differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/output-info.ini b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/output-info.ini deleted file mode 100644 index 16f65ef5a..000000000 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/part4/output-info.ini and /dev/null differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index b1484077e..1d309f495 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -21,7 +21,7 @@ - + @@ -72,9 +72,17 @@ + + + + + + + + @@ -101,6 +109,7 @@ + @@ -120,20 +129,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -169,15 +205,19 @@ + + + + - + - + @@ -205,18 +245,27 @@ - + + + + + + + + + + @@ -260,12 +309,14 @@ + + @@ -285,12 +336,23 @@ + + + + + + + + + + + @@ -304,13 +366,30 @@ + + + + + + + + + + + + + + + + + @@ -405,9 +484,20 @@ + + + + + + + + + + + @@ -419,7 +509,7 @@ - + @@ -487,7 +577,6 @@ - diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk index 9c6368954..da66ca4e4 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 87ec99d02..456dac5c1 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/Build/Shortcuts/Proto Compiler GUI.lnk b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk index 74475c931..df5f34b99 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk and b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs index 3ee81f19b..fb5fbc27c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs @@ -6,7 +6,9 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; +using Tango.AdvancedInstaller; using Tango.Core; using Tango.Core.Cryptography; using Tango.Core.Helpers; @@ -127,6 +129,19 @@ namespace Tango.MachineStudio.Common.Publish throw new FileNotFoundException($"Could not locate the machine studio executable at {appPath}."); } + if (!String.IsNullOrWhiteSpace(Options.InstallerProject)) + { + if (!File.Exists(Options.InstallerProject)) + { + throw new FileNotFoundException($"Installer project not found at '{Options.InstallerProject}'."); + } + + if (!Directory.Exists(Options.InstallerOutputFolder)) + { + throw new DirectoryNotFoundException($"Installer output folder does not exists '{Options.InstallerOutputFolder}'."); + } + } + String tempFile = TemporaryManager.CreateFile(); return Task.Factory.StartNew(() => @@ -155,8 +170,33 @@ namespace Tango.MachineStudio.Common.Publish { Version = local_version, Comments = Options.Comments, + WithInstaller = !String.IsNullOrWhiteSpace(Options.InstallerProject), }).Result; + if (!String.IsNullOrWhiteSpace(Options.InstallerProject)) + { + String output_folder = Options.InstallerOutputFolder; + OnPublishProgress(0, 100, $"Building installer project..."); + InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject); + String installer_name = $"Machine Studio Installer_v{Version.Parse(local_version).ToString(3)}.exe"; + String output_file = Path.Combine(output_folder, installer_name); + installerBuilder.Build(local_version, output_file).Wait(); + + Thread.Sleep(5000); + + OnPublishProgress(0, 100, $"Uploading installer '{installer_name}'..."); + + using (StorageBlobUploader uploader = new StorageBlobUploader(response.InstallerBlobAddress, output_file)) + { + uploader.Progress += (x, e) => + { + OnPublishProgress(e.Current, e.Total, $"Uploading installer {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); + }; + + uploader.Upload().Wait(); + } + } + OnPublishProgress(0, 100, $"Starting version packaging..."); using (ZipFile zip = new ZipFile()) @@ -188,7 +228,7 @@ namespace Tango.MachineStudio.Common.Publish { uploader.Progress += (x, e) => { - OnPublishProgress(e.Current, e.Total, $"Uploading to storage {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); + OnPublishProgress(e.Current, e.Total, $"Uploading version {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); }; uploader.Upload().Wait(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs index 047d7c0b4..c5db355b1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs @@ -73,6 +73,14 @@ namespace Tango.MachineStudio.Common.Publish set { _installerProject = value; RaisePropertyChangedAuto(); } } + private String _installerOutputFolder; + [Option("installer-output-folder", HelpText = "Specifies where to save the installer application.", Required = false)] + public String InstallerOutputFolder + { + get { return _installerOutputFolder; } + set { _installerOutputFolder = value; RaisePropertyChangedAuto(); } + } + public PublishOptions() { BasePath = AppDomain.CurrentDomain.BaseDirectory + "..\\"; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 3f9133d43..5d9c48cd4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -230,6 +230,10 @@ {bb2abb74-ba58-4812-83aa-ec8171f42df4} Tango.AutoComplete + + {c5df1816-34e5-4700-824c-29623a1baa22} + Tango.AdvancedInstaller + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -326,7 +330,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs index d27f48648..394658813 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs @@ -13,5 +13,7 @@ namespace Tango.MachineStudio.Common.Web public String Version { get; set; } public String Comments { get; set; } + + public bool WithInstaller { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs index 9fb3ab94d..a5c5f8e56 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionResponse.cs @@ -13,5 +13,7 @@ namespace Tango.MachineStudio.Common.Web public String Token { get; set; } public String BlobAddress { get; set; } + + public String InstallerBlobAddress { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindow.xaml index b860994fd..0687ffed7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:web="clr-namespace:Tango.Web;assembly=Tango.Web" mc:Ignorable="d" - Title="Machine Studio Publisher" Height="482" Width="700" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize" Foreground="#202020" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"> + Title="Machine Studio Publisher" Height="520" Width="700" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize" Foreground="#202020" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"> @@ -67,8 +67,18 @@ + + Installer Project: + + + + + Installer Output Folder: + + + Comments - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs index e227c0904..479a657d6 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs @@ -63,7 +63,7 @@ namespace Tango.MachineStudio.Publisher.UI { PublishCommand = new RelayCommand(Publish, () => Options.Email != null && Options.Password != null && Options.Comments != null && LocalVersion != null && RemoteVersion != null && IsFree); - Options = new PublishOptions(); + Options = SettingsManager.Default.GetOrCreate().Options; _publisher = new MachineStudioPublisher(Options); _publisher.PublishProgress += _publisher_PublishProgress; @@ -93,6 +93,8 @@ namespace Tango.MachineStudio.Publisher.UI private async void Publish() { + SettingsManager.Default.Save(); + if (!ShowQuestion("Did you remember to synchronize production database ?")) { return; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/PublisherSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/PublisherSettings.cs new file mode 100644 index 000000000..dda722765 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/PublisherSettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Common.Publish; +using Tango.Settings; + +namespace Tango.MachineStudio.Publisher.UI +{ + public class PublisherSettings : SettingsBase + { + public PublishOptions Options { get; set; } + + public PublisherSettings() + { + Options = new PublishOptions(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/Tango.MachineStudio.Publisher.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/Tango.MachineStudio.Publisher.UI.csproj index f7b753e02..edcdfb567 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/Tango.MachineStudio.Publisher.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/Tango.MachineStudio.Publisher.UI.csproj @@ -82,6 +82,7 @@ MSBuild:Compile Designer + MSBuild:Compile Designer @@ -174,7 +175,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs index 65709d46f..7c6113829 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs @@ -5,7 +5,9 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; +using Tango.AdvancedInstaller; using Tango.Core; using Tango.Core.Helpers; using Tango.PPC.Common.Web; @@ -136,6 +138,19 @@ namespace Tango.PPC.Common.Publish throw new FileNotFoundException($"Could not locate the PPC executable at {appPath}."); } + if (!String.IsNullOrWhiteSpace(Options.InstallerProject)) + { + if (!File.Exists(Options.InstallerProject)) + { + throw new FileNotFoundException($"Installer project not found at '{Options.InstallerProject}'."); + } + + if (!Directory.Exists(Options.InstallerOutputFolder)) + { + throw new DirectoryNotFoundException($"Installer output folder does not exists '{Options.InstallerOutputFolder}'."); + } + } + return Task.Factory.StartNew(() => { String tempFile = TemporaryManager.CreateFile(".zip"); @@ -165,8 +180,34 @@ namespace Tango.PPC.Common.Publish Comments = Options.Comments, Version = local_version, MachineVersionGuid = Options.MachineVersionGuid, + WithInstaller = !String.IsNullOrWhiteSpace(Options.InstallerProject), }).Result; + + if (!String.IsNullOrWhiteSpace(Options.InstallerProject)) + { + String output_folder = Options.InstallerOutputFolder; + OnPublishProgress(0, 100, $"Building installer project..."); + InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject); + String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3)}.exe"; + String output_file = Path.Combine(output_folder, installer_name); + installerBuilder.Build(local_version, output_file).Wait(); + + Thread.Sleep(5000); + + OnPublishProgress(0, 100, $"Uploading installer '{installer_name}'..."); + + using (StorageBlobUploader uploader = new StorageBlobUploader(response.InstallerBlobAddress, output_file)) + { + uploader.Progress += (x, e) => + { + OnPublishProgress(e.Current, e.Total, $"Uploading installer {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); + }; + + uploader.Upload().Wait(); + } + } + CreateTupPackage(tempFile).Wait(); OnPublishProgress(0, 100, $"Starting version upload..."); @@ -177,7 +218,7 @@ namespace Tango.PPC.Common.Publish { InvokeUINow(() => { - OnPublishProgress(e.Current, e.Total, $"Uploading to storage {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); + OnPublishProgress(e.Current, e.Total, $"Uploading version {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true); }); }; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs index fa04d8331..4c40acb44 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs @@ -66,14 +66,6 @@ namespace Tango.PPC.Common.Publish set { _environment = value; RaisePropertyChangedAuto(); EnvironmentChanged?.Invoke(this, new EventArgs()); } } - private String _installerProject; - [Option("installer-project-file", HelpText = "Specifies the advanced installer project file to build and upload.", Required = false)] - public String InstallerProject - { - get { return _installerProject; } - set { _installerProject = value; RaisePropertyChangedAuto(); } - } - private String _machineVersionGuid; [Option("machine-version-guid", HelpText = "Specifies the machine version id for which to upload the PPC version.", Required = true)] public String MachineVersionGuid @@ -90,6 +82,22 @@ namespace Tango.PPC.Common.Publish set { _tfpPath = value; RaisePropertyChangedAuto(); } } + private String _installerProject; + [Option("installer-project-file", HelpText = "Specifies the advanced installer project file to build and upload.", Required = false)] + public String InstallerProject + { + get { return _installerProject; } + set { _installerProject = value; RaisePropertyChangedAuto(); } + } + + private String _installerOutputFolder; + [Option("installer-output-folder", HelpText = "Specifies where to save the installer application.", Required = false)] + public String InstallerOutputFolder + { + get { return _installerOutputFolder; } + set { _installerOutputFolder = value; RaisePropertyChangedAuto(); } + } + private SynchronizationOptions _synchronization; public SynchronizationOptions Synchronization { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index fe2f87fb2..07ea6c5d1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -285,6 +285,10 @@ + + {c5df1816-34e5-4700-824c-29623a1baa22} + Tango.AdvancedInstaller + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -367,7 +371,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs index d75a94300..29d533043 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs @@ -15,5 +15,7 @@ namespace Tango.PPC.Common.Web public String MachineVersionGuid { get; set; } public String Comments { get; set; } + + public bool WithInstaller { get; set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs index 9a0fc1a5f..0b4859915 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs @@ -13,5 +13,7 @@ namespace Tango.PPC.Common.Web public String Token { get; set; } public String BlobAddress { get; set; } + + public String InstallerBlobAddress { get; set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml index f29b6bd44..f74194222 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml @@ -29,98 +29,108 @@ - - - - + Tango Publish Utility + + + + + + + + + + - - Tango Publish Utility - - - Deployment Slot: - - - - - Build Configuration: - - Release - Debug - - - - - Selected machine version: - - - - + + + + + Deployment Slot: + + + + + Build Configuration: + + Release + Debug + + + + + Selected machine version: + + + + Remote Version: - + Local Version: - Examiner Provision Sequence Items - - - - - - - - - - - - - Examiner Update Sequence Items - - - - - - - - - - - - - Firmware Upgrade Package - - - - - - - - Comments - - - Email - - - Password - + Examiner Provision Sequence Items + + + + + + + + + + + + + Examiner Update Sequence Items + + + + + + + + + + + + + Firmware Upgrade Package + + + + + + + Installer Project + + Installer Output Folder + + + + + + Comments + + + Email + + + Password + + - - - - - - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index efc5f8179..d72e75011 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/Tango.BL/DTO/MachineStudioVersionDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/MachineStudioVersionDTOBase.cs index c64e8d5a0..116d74910 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/MachineStudioVersionDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/MachineStudioVersionDTOBase.cs @@ -37,6 +37,14 @@ namespace Tango.BL.DTO get; set; } + /// + /// installer blob name + /// + public String InstallerBlobName + { + get; set; + } + /// /// comments /// diff --git a/Software/Visual_Studio/Tango.BL/DTO/TangoVersionDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/TangoVersionDTOBase.cs index a1995fc74..7e744706a 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/TangoVersionDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/TangoVersionDTOBase.cs @@ -37,6 +37,14 @@ namespace Tango.BL.DTO get; set; } + /// + /// installer blob name + /// + public String InstallerBlobName + { + get; set; + } + /// /// comments /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs index 93c0f2518..edbddb240 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs @@ -29,6 +29,8 @@ namespace Tango.BL.Entities public event EventHandler BlobNameChanged; + public event EventHandler InstallerBlobNameChanged; + public event EventHandler CommentsChanged; public event EventHandler UserChanged; @@ -87,6 +89,33 @@ namespace Tango.BL.Entities } } + protected String _installerblobname; + + /// + /// Gets or sets the machinestudioversionbase installer blob name. + /// + + [Column("INSTALLER_BLOB_NAME")] + + public String InstallerBlobName + { + get + { + return _installerblobname; + } + + set + { + if (_installerblobname != value) + { + _installerblobname = value; + + OnInstallerBlobNameChanged(value); + + } + } + } + protected String _comments; /// @@ -184,6 +213,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(BlobName)); } + /// + /// Called when the InstallerBlobName has changed. + /// + protected virtual void OnInstallerBlobNameChanged(String installerblobname) + { + InstallerBlobNameChanged?.Invoke(this, installerblobname); + RaisePropertyChanged(nameof(InstallerBlobName)); + } + /// /// Called when the Comments has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs index bbb4d6c44..7f198017e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs @@ -29,6 +29,8 @@ namespace Tango.BL.Entities public event EventHandler BlobNameChanged; + public event EventHandler InstallerBlobNameChanged; + public event EventHandler CommentsChanged; public event EventHandler MachineVersionChanged; @@ -89,6 +91,33 @@ namespace Tango.BL.Entities } } + protected String _installerblobname; + + /// + /// Gets or sets the tangoversionbase installer blob name. + /// + + [Column("INSTALLER_BLOB_NAME")] + + public String InstallerBlobName + { + get + { + return _installerblobname; + } + + set + { + if (_installerblobname != value) + { + _installerblobname = value; + + OnInstallerBlobNameChanged(value); + + } + } + } + protected String _comments; /// @@ -238,6 +267,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(BlobName)); } + /// + /// Called when the InstallerBlobName has changed. + /// + protected virtual void OnInstallerBlobNameChanged(String installerblobname) + { + InstallerBlobNameChanged?.Invoke(this, installerblobname); + RaisePropertyChanged(nameof(InstallerBlobName)); + } + /// /// Called when the Comments has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 261ed00f5..c08729ef9 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -549,7 +549,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs index 9154109f5..608d84a77 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs @@ -19,6 +19,7 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public string VERSION { get; set; } public string BLOB_NAME { get; set; } + public string INSTALLER_BLOB_NAME { get; set; } public string COMMENTS { get; set; } public string USER_GUID { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs index d26e67908..17bc2683d 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs @@ -1,4 +1,4 @@ -// T4 code generation is enabled for model 'C:\DATA\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. +// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 1f4d6f28c..f889898fd 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -630,6 +630,7 @@ + @@ -913,6 +914,7 @@ + @@ -3542,6 +3544,7 @@ + @@ -3870,6 +3873,7 @@ + @@ -5692,6 +5696,7 @@ + @@ -5987,6 +5992,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 50c2c4131..2f86ca238 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,76 +5,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TANGO_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TANGO_VERSIONS.cs index 70b2ad771..6c24d1eee 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/TANGO_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/TANGO_VERSIONS.cs @@ -19,6 +19,7 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public string VERSION { get; set; } public string BLOB_NAME { get; set; } + public string INSTALLER_BLOB_NAME { get; set; } public string COMMENTS { get; set; } public string USER_GUID { get; set; } public string MACHINE_VERSION_GUID { get; set; } diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs index 1a66d0fe6..b718887af 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs @@ -162,11 +162,11 @@ namespace Tango.MachineService.Controllers if (user != null && user.HasPermission(Permissions.PublishMachineStudioVersions)) { var latestVersion = db.MachineStudioVersions.ToList().OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); - Version currentVersion = Version.Parse(request.Version); + Version local_version = Version.Parse(request.Version); - if (latestVersion == null || currentVersion > Version.Parse(latestVersion.Version)) + if (latestVersion == null || local_version > Version.Parse(latestVersion.Version)) { - String newVersionFileName = "Machine Studio Version" + " " + currentVersion.ToString() + ".zip"; + String newVersionFileName = "Machine Studio v" + local_version.ToString() + ".zip"; var manager = new BlobStorageManager(); var container = manager.GetContainer(MachineServiceConfig.MACHINE_STUDIO_VERSIONS_CONTAINER); @@ -175,14 +175,24 @@ namespace Tango.MachineService.Controllers response.Token = Guid.NewGuid().ToString(); response.BlobAddress = blob.GenerateWriteSignature(TimeSpan.FromMinutes(30)); - _pendingUploads.Add(new MachineStudioPendingUpload() + MachineStudioPendingUpload pending_upload = new MachineStudioPendingUpload() { UserGuid = user.Guid, Comments = request.Comments, Token = response.Token, Version = request.Version, BlobName = blob.Name, - }); + }; + + if (request.WithInstaller) + { + String installerVersionFileName = "Machine Studio v" + local_version.ToString() + ".exe"; + var installerBlob = container.CreateEmptyBlob(installerVersionFileName); + response.InstallerBlobAddress = installerBlob.GenerateWriteSignature(TimeSpan.FromMinutes(30)); + pending_upload.InstallerBlobName = installerBlob.Name; + } + + _pendingUploads.Add(pending_upload); } else { @@ -220,6 +230,7 @@ namespace Tango.MachineService.Controllers { Comments = upload.Comments, BlobName = upload.BlobName, + InstallerBlobName = upload.InstallerBlobName, UserGuid = upload.UserGuid, Version = upload.Version, }); diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs index b937afbb0..a2016d4e0 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs @@ -325,11 +325,11 @@ namespace Tango.MachineService.Controllers latestVersion = versions.FirstOrDefault(); } - Version currentVersion = Version.Parse(request.Version); + Version local_version = Version.Parse(request.Version); - if (currentVersion > Version.Parse(latestVersion.Version)) + if (local_version > Version.Parse(latestVersion.Version)) { - String newVersionFileName = $"{machine_version.Name} - Tango Version {currentVersion.ToString()}.tup"; + String newVersionFileName = $"{machine_version.Name} - Tango Version {local_version.ToString()}.tup"; var manager = new BlobStorageManager(); var container = manager.GetContainer(MachineServiceConfig.TANGO_VERSIONS_CONTAINER); @@ -338,7 +338,7 @@ namespace Tango.MachineService.Controllers response.Token = Guid.NewGuid().ToString(); response.BlobAddress = blob.GenerateWriteSignature(TimeSpan.FromMinutes(30)); - _pendingUploads.Add(new PPCPendingUpload() + PPCPendingUpload pending_upload = new PPCPendingUpload() { UserGuid = user.Guid, Comments = request.Comments, @@ -346,7 +346,17 @@ namespace Tango.MachineService.Controllers Version = request.Version, BlobName = blob.Name, MachineVersionGuid = request.MachineVersionGuid, - }); + }; + + if (request.WithInstaller) + { + String installerVersionFileName = Path.ChangeExtension(newVersionFileName, ".exe"); + var installerBlob = container.CreateEmptyBlob(installerVersionFileName); + response.InstallerBlobAddress = installerBlob.GenerateWriteSignature(TimeSpan.FromMinutes(30)); + pending_upload.InstallerBlobName = installerBlob.Name; + } + + _pendingUploads.Add(pending_upload); } else { @@ -378,9 +388,10 @@ namespace Tango.MachineService.Controllers { Comments = upload.Comments, BlobName = upload.BlobName, + InstallerBlobName = upload.InstallerBlobName, UserGuid = upload.UserGuid, Version = upload.Version, - MachineVersionGuid = upload.MachineVersionGuid + MachineVersionGuid = upload.MachineVersionGuid, }); db.SaveChanges(); diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Models/MachineStudioPendingUpload.cs b/Software/Visual_Studio/Web/Tango.MachineService/Models/MachineStudioPendingUpload.cs index e537d7d44..871f926d6 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Models/MachineStudioPendingUpload.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Models/MachineStudioPendingUpload.cs @@ -15,8 +15,8 @@ namespace Tango.MachineService.Models public String Comments { get; set; } - public String FilePath { get; set; } - public String BlobName { get; set; } + + public String InstallerBlobName { get; set; } } } \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Models/PPCPendingUpload.cs b/Software/Visual_Studio/Web/Tango.MachineService/Models/PPCPendingUpload.cs index 10797e758..b97d8b6c8 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Models/PPCPendingUpload.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Models/PPCPendingUpload.cs @@ -18,5 +18,7 @@ namespace Tango.MachineService.Models public String MachineVersionGuid { get; set; } public String BlobName { get; set; } + + public String InstallerBlobName { get; set; } } } \ No newline at end of file -- cgit v1.3.1