From 992208add11db73cb1ffb48c5ccedb0c883aafd0 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 2 Nov 2022 04:49:10 +0200 Subject: PPC multi version support completed on PPC,FSE,MS,DB. --- .../PPC/Tango.PPC.Publisher.UI/MainWindow.xaml | 4 ++-- .../PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs | 20 ++++++++++++++++++-- .../Tango.PPC.Publisher.UI.csproj | 6 ++++++ 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI') 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 a8532646f..5697f2027 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml @@ -10,7 +10,7 @@ xmlns:web="clr-namespace:Tango.Web;assembly=Tango.Web" xmlns:local="clr-namespace:Tango.PPC.Publisher.UI" mc:Ignorable="d" - Title="Tango PPC Publisher" Height="1000" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}" WindowStartupLocation="CenterScreen"> + Title="Tango PPC Publisher" d:DesignHeight="1200" Height="800" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}" WindowStartupLocation="CenterScreen"> @@ -123,7 +123,7 @@ Tag - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs index c2eedff13..3138f2d69 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs @@ -21,6 +21,7 @@ using Tango.BL.DTO; using Tango.BL.Entities; using Tango.Core; using Tango.Core.Commands; +using Tango.Core.Components; using Tango.Core.Cryptography; using Tango.Core.Helpers; using Tango.Core.IO; @@ -157,6 +158,7 @@ namespace Tango.PPC.Publisher.UI Options.EnvironmentChanged += async (_, __) => await OnEnvironmentChanged(); Options.BuidConfigChanged += async (_, __) => await UpdateVersions(); Options.TfpPathChanged += async (_, __) => await UpdateVersions(); + Options.TagChanged += async (_, __) => await UpdateVersions(); Init(); } @@ -198,13 +200,13 @@ namespace Tango.PPC.Publisher.UI DirectoryInfo di = new DirectoryInfo(Options.GetApplicationPath()); long totalSize = di.GetFiles("*", SearchOption.AllDirectories).Sum(x => x.Length); - PackageSize = totalSize.FileSizeToString(); + PackageSize = totalSize.FileSizeToString(); try { LocalFirmwareVersion = _publisher.GetLocalFirmwareVersion(Options.TfpPath); } - catch {} + catch { } if (SelectedMachineVersion != null) { @@ -233,6 +235,20 @@ namespace Tango.PPC.Publisher.UI { IsFree = false; SettingsManager.Default.Save(); + + if (String.IsNullOrWhiteSpace(Options.Tag)) + { + Options.Tag = null; + } + + CmdCommand cmdCommand = new CmdCommand("rc.exe", $"\"{_publisher.GetPPCExecutablePath()}\" --set-version-string \"Comments\" \"{Options.Tag}\""); + var result = await cmdCommand.Run(); + + if (result.ExitCode != 0) + { + throw new Exception("Error modifying version tag on output."); + } + await _publisher.Publish(); ShowInfo("Version published successfully."); await UpdateVersions(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj index 332554ffc..778117469 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj @@ -189,6 +189,12 @@ false + + + rc.exe + PreserveNewest + + -- cgit v1.3.1