diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-11-02 04:49:10 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-11-02 04:49:10 +0200 |
| commit | 992208add11db73cb1ffb48c5ccedb0c883aafd0 (patch) | |
| tree | e8b753bca8f341c105b8b1cb7761e2282a13881e /Software/Visual_Studio/PPC | |
| parent | 5ab455fb09c659e92ad4de41ec7472e2b8e48499 (diff) | |
| download | Tango-992208add11db73cb1ffb48c5ccedb0c883aafd0.tar.gz Tango-992208add11db73cb1ffb48c5ccedb0c883aafd0.zip | |
PPC multi version support completed on PPC,FSE,MS,DB.
Diffstat (limited to 'Software/Visual_Studio/PPC')
23 files changed, 104 insertions, 16 deletions
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 @@ <TableCell> <Paragraph> - <TextBlock Text="{Binding ApplicationManager.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> + <TextBlock Text="{Binding ApplicationManager.VersionAndTag,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> </Paragraph> </TableCell> </TableRow> 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 @@ </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="Date" Width="120" Binding="{Binding StartDate,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" /> - <DataGridTextColumn Header="Application" Width="120" Binding="{Binding ApplicationVersion}" /> + <DataGridTextColumn Header="Application" Width="120" Binding="{Binding VersionAndTag}" /> <DataGridTextColumn Header="Firmware" Width="120" Binding="{Binding FirmwareVersion}" /> <DataGridTemplateColumn Header="Message" Width="1*"> <DataGridTemplateColumn.CellTemplate> 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 @@ -111,6 +111,16 @@ namespace Tango.PPC.Common.Application Version FirmwareVersion { get; } /// <summary> + /// Gets the version tag. + /// </summary> + String VersionTag { get; } + + /// <summary> + /// Gets the version and tag display. + /// </summary> + String VersionAndTag { get; } + + /// <summary> /// Gets the application build date. /// </summary> String BuildDate { get; } 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<LatestVersionResponse> 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<SystemObjectProperty>() { - 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<UpdatedEntity> Catalogs { get; set; } public DateTime MachineLastUpdated { get; set; } public List<String> 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"> <Window.Resources> <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> @@ -123,7 +123,7 @@ <StackPanel Margin="0 20 0 0"> <TextBlock>Tag</TextBlock> - <ComboBox IsEditable="True" ItemsSource="{Binding Tags}" SelectedItem="{Binding Options.Tag}"></ComboBox> + <ComboBox IsEditable="True" ItemsSource="{Binding Tags}" Text="{Binding Options.Tag,Delay=1000,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></ComboBox> </StackPanel> <StackPanel Margin="0 20 0 0"> 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 @@ <Install>false</Install> </BootstrapperPackage> </ItemGroup> + <ItemGroup> + <None Include="..\rc.exe"> + <Link>rc.exe</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> 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 { @@ -136,6 +137,27 @@ namespace Tango.PPC.UI.PPCApplication } /// <summary> + /// Gets the version tag. + /// </summary> + public String VersionTag + { + get + { + var str = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).Comments; + return str.IsNotNullOrEmpty() ? str : null; + + } + } + + /// <summary> + /// Gets the version and tag display. + /// </summary> + public String VersionAndTag + { + get { return Version.ToString(3) + $"{(VersionTag.IsNotNullOrEmpty() ? $" [{VersionTag}]" : String.Empty)}"; } + } + + /// <summary> /// Gets the application startup date. /// </summary> public DateTime StartUpDate { get; private set; } 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 @@ <Resource Include="Images\bit.png" /> <Resource Include="Images\bit_new.png" /> <Resource Include="Images\loading_anim2.gif" /> + <None Include="..\rc.exe"> + <Link>rc.exe</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="firmware_package.tfp"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="GetVersionTag.bat"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> @@ -806,7 +813,9 @@ if $(ConfigurationName) == Release del *.xml if $(ConfigurationName) == Release del WebRtc.NET.pdb -if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)"</PostBuildEvent> +if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" + +if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string "Comments" "Coats"</PostBuildEvent> </PropertyGroup> <PropertyGroup> <PreBuildEvent>copy /Y "$(ProjectDir)Manifests\$(ConfigurationName).xml" "$(ProjectDir)app.manifest" @@ -814,7 +823,7 @@ if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)"</ </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ 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 @@ <Run FontStyle="Italic" Text="{Binding MachineProvider.Machine.SerialNumber,Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run> <Run>|</Run> <Run>Version:</Run> - <Run FontStyle="Italic" Text="{Binding ApplicationManager.Version,FallbackValue='1.0.0.0',Mode=OneWay,IsAsync=True}"></Run> + <Run FontStyle="Italic" Text="{Binding ApplicationManager.VersionAndTag,FallbackValue='1.0.0.0',Mode=OneWay,IsAsync=True}"></Run> </TextBlock> <TextBlock Margin="5 0 0 0" Foreground="{StaticResource TangoGrayTextBrush}" FontSize="{StaticResource TangoSmallFontSize}"> 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 @@ </Grid> <TextBlock Margin="0 40 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> - <Run>v</Run><Run Text="{Binding ApplicationManager.Version,Mode=OneWay}"></Run> + <Run>v</Run><Run Text="{Binding ApplicationManager.VersionAndTag,Mode=OneWay}"></Run> </TextBlock> <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 100 0 0" HorizontalAlignment="Center" Width="150"> <TextBlock.Style> diff --git a/Software/Visual_Studio/PPC/rc.exe b/Software/Visual_Studio/PPC/rc.exe Binary files differnew file mode 100644 index 000000000..36764c62d --- /dev/null +++ b/Software/Visual_Studio/PPC/rc.exe |
