Removed XenCenterVersion from BrandManager. Use the Program.Version instead.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-01-14 04:29:04 +00:00
parent f7796582c3
commit 775f3e49a9
7 changed files with 19 additions and 17 deletions

View File

@ -37,3 +37,10 @@ using System.Reflection;
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0000")]
/*
* .NET Framework 4.8 docs: All components of the version must be integers greater
* than or equal to 0. Metadata restricts the major, minor, build, and revision
* components for an assembly to a maximum value of UInt16.MaxValue - 1.
* If a component exceeds this value, a compilation error occurs.
*/

View File

@ -92,7 +92,7 @@ namespace XenAdmin.Core
if (Properties.Settings.Default.AllowXenCenterUpdates || userRequested)
{
string userAgent = $"{BrandManager.BrandConsole}/{BrandManager.XenCenterVersion}.{Program.Version.Revision} ({IntPtr.Size * 8}-bit)";
string userAgent = $"{BrandManager.BrandConsole}/{Program.Version} ({IntPtr.Size * 8}-bit)";
var action = new DownloadUpdatesXmlAction(Properties.Settings.Default.AllowXenCenterUpdates || userRequested,
false, false, userAgent, !userRequested);

View File

@ -46,10 +46,8 @@ namespace XenAdmin.Dialogs
{
InitializeComponent();
var revision = Program.Version.Revision;
VersionLabel.Text = string.Format(Messages.VERSION_NUMBER, BrandManager.BrandConsole,
BrandManager.XenCenterVersion, revision, IntPtr.Size * 8);
Program.VersionText, Program.Version.Revision, IntPtr.Size * 8);
if (Helpers.CommonCriteriaCertificationRelease)
VersionLabel.Text += string.Format(Messages.COMMON_CRITERIA_TEXT, BrandManager.ProductBrand);

View File

@ -52,9 +52,8 @@ namespace XenAdmin.Help
{
HelpUrl = InvisibleMessages.DOCS_URL + BrandManager.HelpPath;
HelpQuery = string.Format(InvisibleMessages.HELP_URL_QUERY,
$"{BrandManager.XenCenterVersion}.{Program.Version.Revision}".Replace('.', '_'),
BrandManager.BrandConsole);
HelpQuery = string.Format(InvisibleMessages.HELP_URL_QUERY,
$"{Program.Version}".Replace('.', '_'), BrandManager.BrandConsole);
}
}

View File

@ -106,7 +106,9 @@ namespace XenAdmin
public static volatile bool Exiting;
public static readonly string AssemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public static readonly string AssemblyDir;
public static readonly Version Version;
public static readonly string VersionText;
private static readonly System.Threading.Timer dailyTimer;
@ -119,6 +121,11 @@ namespace XenAdmin
LogApplicationStats();
}, null, new TimeSpan(24, 0, 0), new TimeSpan(24, 0, 0));
var assembly = Assembly.GetExecutingAssembly();
AssemblyDir = Path.GetDirectoryName(assembly.Location);
Version = assembly.GetName().Version;
VersionText = $"{Version.Major}.{Version.Minor}.{Version.Build}";
var logFolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
BrandManager.ProductBrand,
@ -723,8 +730,6 @@ namespace XenAdmin
/// </summary>
public static bool ForcedExiting = false;
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
public static string CurrentLanguage => Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
public static string VersionAndLanguage => $"{Version}.{CurrentLanguage}";

View File

@ -55,7 +55,6 @@ namespace XenAdmin.Core
ProductVersionPost82 = customBranding.ProductVersionText;
UpdatesUrl = customBranding.UpdatesUrl;
VmTools = customBranding.VmTools;
XenCenterVersion = customBranding.XenCenterVersion;
XenHost = customBranding.XenHost;
}
@ -110,8 +109,6 @@ namespace XenAdmin.Core
public static readonly string VmTools;
public static readonly string XenCenterVersion;
public static readonly string XenHost;

View File

@ -63,7 +63,6 @@ using XenAdmin.Properties;
"[XenServer version]",
"[Updates url]",
"[Guest Tools]",
"0.0.0",
"[XenServer host]")]
namespace XenAdmin.Properties
@ -80,7 +79,6 @@ namespace XenAdmin.Properties
string productVersionText,
string updatesUrl,
string vmTools,
string xenCenterVersion,
string xenHost)
{
BrandConsole = brandConsole;
@ -91,7 +89,6 @@ namespace XenAdmin.Properties
ProductVersionText = productVersionText;
UpdatesUrl = updatesUrl;
VmTools = vmTools;
XenCenterVersion = xenCenterVersion;
XenHost = xenHost;
}
@ -103,7 +100,6 @@ namespace XenAdmin.Properties
public string ProductVersionText { get; }
public string VmTools { get; }
public string UpdatesUrl { get; }
public string XenCenterVersion { get; }
public string XenHost { get; }
}
}