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. --- .../Tango.PPC.Technician/Views/SystemView.xaml | 2 +- .../Tango.PPC.Technician/Views/UpdatesView.xaml | 2 +- .../Application/IPPCApplicationManager.cs | 10 ++++++++++ .../MachineUpdate/MachineUpdateManager.cs | 9 +++++++++ .../PPC/Tango.PPC.Common/Publish/PPCPublisher.cs | 6 ++++-- .../PPC/Tango.PPC.Common/Publish/PublishInfo.cs | 1 + .../PPC/Tango.PPC.Common/Publish/PublishOptions.cs | 5 +++-- .../SystemInfo/DefaultSystemInfoService.cs | 2 +- .../Tango.PPC.Common/Web/CheckForUpdateRequest.cs | 2 ++ .../Tango.PPC.Common/Web/CheckForUpdateResponse.cs | 1 + .../Tango.PPC.Common/Web/DownloadUpdateResponse.cs | 2 ++ .../Tango.PPC.Common/Web/LatestVersionRequest.cs | 1 + .../Tango.PPC.Common/Web/MachineSetupResponse.cs | 2 ++ .../PPC/Tango.PPC.Publisher.UI/MainWindow.xaml | 4 ++-- .../PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs | 20 +++++++++++++++++-- .../Tango.PPC.Publisher.UI.csproj | 6 ++++++ .../PPC/Tango.PPC.UI/GetVersionTag.bat | 4 ++++ .../PPCApplication/DefaultPPCApplicationManager.cs | 22 +++++++++++++++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 13 ++++++++++-- .../ViewModels/ExternalBridgeViewVM.cs | 2 +- .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 2 +- .../PPC/Tango.PPC.UI/Views/LoadingView.xaml | 2 +- Software/Visual_Studio/PPC/rc.exe | Bin 0 -> 1308672 bytes 23 files changed, 104 insertions(+), 16 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/GetVersionTag.bat create mode 100644 Software/Visual_Studio/PPC/rc.exe (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml index 292a87bb9..fc0f734ff 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml @@ -155,7 +155,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml index 501632bfa..1d2393f41 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml @@ -83,7 +83,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs index a9d4e7c3a..6002b3809 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs @@ -110,6 +110,16 @@ namespace Tango.PPC.Common.Application /// Version FirmwareVersion { get; } + /// + /// Gets the version tag. + /// + String VersionTag { get; } + + /// + /// Gets the version and tag display. + /// + String VersionAndTag { get; } + /// /// Gets the application build date. /// 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 642707e87..c5412e591 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -265,6 +265,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = response.Version; update.FirmwareVersion = response.FirmwareVersion; + update.ApplicationVersionTag = response.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.UpdateFailed; update.StartDate = _updateStartDate; @@ -291,6 +292,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = tupPublishInfo.ApplicationVersion; update.FirmwareVersion = tupPublishInfo.GetFirmwareVersion(); + update.ApplicationVersionTag = tupPublishInfo.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineUpdateFailed; update.StartDate = _updateStartDate; @@ -382,6 +384,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = response.Version; update.FirmwareVersion = response.FirmwareVersion; + update.ApplicationVersionTag = response.Tag; update.MachineGuid = (await db.Machines.FirstAsync()).Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.UpdateCompleted; update.StartDate = _updateStartDate; @@ -406,6 +409,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = tupPublishInfo.ApplicationVersion; update.FirmwareVersion = tupPublishInfo.GetFirmwareVersion(); + update.ApplicationVersionTag = tupPublishInfo.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineUpdateCompleted; update.StartDate = _updateStartDate; @@ -481,6 +485,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = _app_manager.FirmwareVersion.ToString(); + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.DatabaseFailed; update.StartDate = _updateStartDate; @@ -527,6 +532,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = _app_manager.FirmwareVersion.ToString(); + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.DatabaseCompleted; update.StartDate = _updateStartDate; @@ -559,6 +565,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = firmwareVersion; + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineFirmwareUpgradeFailed; update.StartDate = _updateStartDate; @@ -589,6 +596,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = firmwareVersion; + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineFirmwareUpgradeCompleted; update.StartDate = _updateStartDate; @@ -947,6 +955,7 @@ namespace Tango.PPC.Common.MachineUpdate CheckForUpdateRequest request = new CheckForUpdateRequest(); request.Version = _app_manager.Version.ToString(); request.FirmwareVersion = _app_manager.FirmwareVersion?.ToString(); + request.Tag = _app_manager.VersionTag; try { 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 810c5b3cb..0e6641cfb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs @@ -63,7 +63,7 @@ namespace Tango.PPC.Common.Publish public async Task GetRemoteVersion(String machineVersionGuid) { _client.Environment = Options.Environment; - var response = await _client.GetLatestVersion(new LatestVersionRequest() { MachineVersionGuid = machineVersionGuid }); + var response = await _client.GetLatestVersion(new LatestVersionRequest() { MachineVersionGuid = machineVersionGuid, Tag = Options.Tag }); return response; } @@ -190,6 +190,7 @@ namespace Tango.PPC.Common.Publish MachineVersionGuid = Options.MachineVersionGuid, WithInstaller = !String.IsNullOrWhiteSpace(Options.InstallerProject), FirmwareVersion = GetVersionInfoFromTFP(Options.TfpPath).FileDescriptors.SingleOrDefault(x => x.Destination == VersionFileDestination.Mcu).Version, + Tag = Options.Tag }).Result; CreateTupPackage(tempFile).Wait(); @@ -199,7 +200,7 @@ namespace Tango.PPC.Common.Publish 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 installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe"; String output_file = Path.Combine(output_folder, installer_name); installerBuilder.Build(local_version, output_file).Wait(); @@ -355,6 +356,7 @@ namespace Tango.PPC.Common.Publish versionInfo.ApplicationVersion = GetLocalVersion(); versionInfo.Comments = Options.Comments; versionInfo.Firmware = GetVersionInfoFromTFP(Options.TfpPath); + versionInfo.Tag = Options.Tag; //Validate the package. versionInfo.Firmware.Validate(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs index 1bbdb80d0..b356ac970 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs @@ -13,6 +13,7 @@ namespace Tango.PPC.Common.Publish { public String ApplicationVersion { get; set; } public VersionPackageDescriptor Firmware { get; set; } + public String Tag { get; set; } public String Comments { get; set; } public bool IsMachineTupPackage { get; set; } public String MachineSerialNumber { get; set; } 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 5b43d4b8c..8e81f5e44 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs @@ -18,6 +18,7 @@ namespace Tango.PPC.Common.Publish public event EventHandler BasicInfoChanged; public event EventHandler MachineVersionGuidChanged; public event EventHandler TfpPathChanged; + public event EventHandler TagChanged; private String basePath; [Option("path", HelpText = "Specifies the application base path.", Required = false)] @@ -62,8 +63,8 @@ namespace Tango.PPC.Common.Publish private String _tag; public String Tag { - get { return _tag; } - set { _tag = value; RaisePropertyChangedAuto(); BasicInfoChanged?.Invoke(this, new EventArgs()); } + get { return _tag.IsNotNullOrEmpty() ? _tag : null; } + set { _tag = value; RaisePropertyChangedAuto(); TagChanged?.Invoke(this, new EventArgs()); } } private DeploymentSlot _environment; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs index 3c3a0247b..e3030aa9d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs @@ -66,7 +66,7 @@ namespace Tango.PPC.Common.SystemInfo Name = "Tango PPC", Properties = new List() { - new SystemObjectProperty() { Name = "Version", Value = _applicationManager.Version.ToString(3) }, + new SystemObjectProperty() { Name = "Version", Value = _applicationManager.VersionAndTag }, new SystemObjectProperty() { Name = "Build Date", Value = _applicationManager.BuildDate }, new SystemObjectProperty() { Name = "Previous Version", Value = settings.PreviousApplicationVersion }, new SystemObjectProperty() { Name = "Firmware Version", Value = _applicationManager.FirmwareVersion.ToStringSafe() }, diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs index 8e13ea7c4..5002d453b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.Transport.Web; namespace Tango.PPC.Common.Web @@ -17,6 +18,7 @@ namespace Tango.PPC.Common.Web public List Catalogs { get; set; } public DateTime MachineLastUpdated { get; set; } public List UsedRmlsGuids { get; set; } + public String Tag { get; set; } public CheckForUpdateRequest() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs index 2fb33ebdc..df654eb72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs @@ -13,6 +13,7 @@ namespace Tango.PPC.Common.Web public bool IsDatabaseUpdateAvailable { get; set; } public String Version { get; set; } public String FirmwareVersion { get; set; } + public String Tag { get; set; } public bool SetupFirmware { get; set; } public bool SetupFPGA { get; set; } public UpdateDBResponse UpdateDBResponse { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs index 2fc7e4810..56e08ba3d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.Common.Web public String Version { get; set; } + public String Tag { get; set; } + public String FirmwareVersion { get; set; } public String BlobAddress { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs index 400bb315c..5983beafe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs @@ -11,5 +11,6 @@ namespace Tango.PPC.Common.Web public class LatestVersionRequest : WebRequestMessage { public String MachineVersionGuid { get; set; } + public String Tag { get; set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs index f5d03c6ce..b6a6ddc2c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.Common.Web public String Version { get; set; } + public String Tag { get; set; } + public String FirmwareVersion { get; set; } public String BlobAddress { 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 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 + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/GetVersionTag.bat b/Software/Visual_Studio/PPC/Tango.PPC.UI/GetVersionTag.bat new file mode 100644 index 000000000..8bcb5c5af --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/GetVersionTag.bat @@ -0,0 +1,4 @@ +@ECHO off +rc.exe "Tango.PPC.UI.exe" --get-version-string "Comments" +echo: +pause \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 83790a56f..9b57da988 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -36,6 +36,7 @@ using Tango.PPC.Common.Navigation; using Tango.PPC.Common.Synchronization; using Tango.Insights; using System.Threading; +using System.Reflection; namespace Tango.PPC.UI.PPCApplication { @@ -135,6 +136,27 @@ namespace Tango.PPC.UI.PPCApplication } } + /// + /// Gets the version tag. + /// + public String VersionTag + { + get + { + var str = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).Comments; + return str.IsNotNullOrEmpty() ? str : null; + + } + } + + /// + /// Gets the version and tag display. + /// + public String VersionAndTag + { + get { return Version.ToString(3) + $"{(VersionTag.IsNotNullOrEmpty() ? $" [{VersionTag}]" : String.Empty)}"; } + } + /// /// Gets the application startup date. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 2d3d25cc3..6f93232ab 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -495,11 +495,18 @@ + + rc.exe + PreserveNewest + PreserveNewest + + PreserveNewest + SettingsSingleFileGenerator @@ -806,7 +813,9 @@ if $(ConfigurationName) == Release del *.xml if $(ConfigurationName) == Release del WebRtc.NET.pdb -if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" +if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" + +if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string "Comments" "Coats" copy /Y "$(ProjectDir)Manifests\$(ConfigurationName).xml" "$(ProjectDir)app.manifest" @@ -814,7 +823,7 @@ if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index f10e84d05..47376b7c7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -142,7 +142,7 @@ namespace Tango.PPC.UI.ViewModels if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword) { - e.ApplicationInformation.Version = ApplicationManager.Version.ToString(); + e.ApplicationInformation.Version = ApplicationManager.VersionAndTag; e.ApplicationInformation.StartupDate = ApplicationManager.StartUpDate.ToUniversalTime().ToString(); Connection = e; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 1417c79f3..3664e3997 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -45,7 +45,7 @@ | Version: - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml index 555a45aea..146d4b50d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml @@ -54,7 +54,7 @@ - v + v diff --git a/Software/Visual_Studio/PPC/rc.exe b/Software/Visual_Studio/PPC/rc.exe new file mode 100644 index 000000000..36764c62d Binary files /dev/null and b/Software/Visual_Studio/PPC/rc.exe differ -- cgit v1.3.1