diff --git a/SafeExamBrowser.Browser/BrowserApplicationController.cs b/SafeExamBrowser.Browser/BrowserApplicationController.cs index 0b39dc75..80e11d37 100644 --- a/SafeExamBrowser.Browser/BrowserApplicationController.cs +++ b/SafeExamBrowser.Browser/BrowserApplicationController.cs @@ -173,7 +173,7 @@ namespace SafeExamBrowser.Browser private string InitializeUserAgent() { var osVersion = $"{Environment.OSVersion.Version.Major}.{Environment.OSVersion.Version.Minor}"; - var sebVersion = $"SEB/{appConfig.ProgramVersion}"; + var sebVersion = $"SEB/{appConfig.ProgramInformationalVersion}"; if (settings.UseCustomUserAgent) { diff --git a/SafeExamBrowser.Browser/Handlers/RequestHandler.cs b/SafeExamBrowser.Browser/Handlers/RequestHandler.cs index 9e47b615..c876c4c7 100644 --- a/SafeExamBrowser.Browser/Handlers/RequestHandler.cs +++ b/SafeExamBrowser.Browser/Handlers/RequestHandler.cs @@ -48,7 +48,7 @@ namespace SafeExamBrowser.Browser.Handlers var headers = new NameValueCollection(request.Headers); var userAgent = request.Headers["User-Agent"]; - headers["User-Agent"] = $"{userAgent} SEB/{appConfig.ProgramVersion}"; + headers["User-Agent"] = $"{userAgent} SEB/{appConfig.ProgramInformationalVersion}"; request.Headers = headers; } diff --git a/SafeExamBrowser.Configuration.UnitTests/ConfigurationRepositoryTests.cs b/SafeExamBrowser.Configuration.UnitTests/ConfigurationRepositoryTests.cs index eb673747..2e0ab7f2 100644 --- a/SafeExamBrowser.Configuration.UnitTests/ConfigurationRepositoryTests.cs +++ b/SafeExamBrowser.Configuration.UnitTests/ConfigurationRepositoryTests.cs @@ -56,7 +56,7 @@ namespace SafeExamBrowser.Configuration.UnitTests fileSaver.Setup(f => f.CanSave(It.IsAny())).Returns(u => u.IsFile); networkLoader.Setup(n => n.CanLoad(It.IsAny())).Returns(u => u.Scheme.Equals("http") || u.Scheme.Equals("seb")); - sut = new ConfigurationRepository(certificateStore.Object, hashAlgorithm.Object, logger.Object, executablePath, string.Empty, string.Empty, string.Empty); + sut = new ConfigurationRepository(certificateStore.Object, hashAlgorithm.Object, logger.Object, executablePath, string.Empty, string.Empty, string.Empty, string.Empty); sut.InitializeAppConfig(); } diff --git a/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs b/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs index ae35ed93..4c6002a1 100644 --- a/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs +++ b/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs @@ -20,13 +20,20 @@ namespace SafeExamBrowser.Configuration.ConfigurationData private AppConfig appConfig; private string executablePath; + private string programBuild; private string programCopyright; private string programTitle; private string programVersion; - internal DataValues(string executablePath, string programCopyright, string programTitle, string programVersion) + internal DataValues( + string executablePath, + string programBuild, + string programCopyright, + string programTitle, + string programVersion) { this.executablePath = executablePath ?? string.Empty; + this.programBuild = programBuild ?? string.Empty; this.programCopyright = programCopyright ?? string.Empty; this.programTitle = programTitle ?? string.Empty; this.programVersion = programVersion ?? string.Empty; @@ -57,10 +64,11 @@ namespace SafeExamBrowser.Configuration.ConfigurationData appConfig.ClientLogFilePath = Path.Combine(logFolder, $"{logFilePrefix}_Client.log"); appConfig.ConfigurationFileExtension = ".seb"; appConfig.DownloadDirectory = Path.Combine(appDataLocalFolder, "Downloads"); + appConfig.ProgramBuildVersion = programBuild; appConfig.ProgramCopyright = programCopyright; appConfig.ProgramDataFilePath = Path.Combine(programDataFolder, DEFAULT_CONFIGURATION_NAME); appConfig.ProgramTitle = programTitle; - appConfig.ProgramVersion = programVersion; + appConfig.ProgramInformationalVersion = programVersion; appConfig.RuntimeId = Guid.NewGuid(); appConfig.RuntimeAddress = $"{AppConfig.BASE_ADDRESS}/runtime/{Guid.NewGuid()}"; appConfig.RuntimeLogFilePath = Path.Combine(logFolder, $"{logFilePrefix}_Runtime.log"); diff --git a/SafeExamBrowser.Configuration/ConfigurationRepository.cs b/SafeExamBrowser.Configuration/ConfigurationRepository.cs index 4630f67f..886e91fa 100644 --- a/SafeExamBrowser.Configuration/ConfigurationRepository.cs +++ b/SafeExamBrowser.Configuration/ConfigurationRepository.cs @@ -37,6 +37,7 @@ namespace SafeExamBrowser.Configuration IHashAlgorithm hashAlgorithm, IModuleLogger logger, string executablePath, + string programBuild, string programCopyright, string programTitle, string programVersion) @@ -48,7 +49,7 @@ namespace SafeExamBrowser.Configuration dataParsers = new List(); dataSerializers = new List(); dataMapper = new DataMapper(); - dataValues = new DataValues(executablePath, programCopyright, programTitle, programVersion); + dataValues = new DataValues(executablePath, programBuild, programCopyright, programTitle, programVersion); resourceLoaders = new List(); resourceSavers = new List(); } diff --git a/SafeExamBrowser.Contracts/Configuration/AppConfig.cs b/SafeExamBrowser.Contracts/Configuration/AppConfig.cs index b1c85ebe..a3adbb32 100644 --- a/SafeExamBrowser.Contracts/Configuration/AppConfig.cs +++ b/SafeExamBrowser.Contracts/Configuration/AppConfig.cs @@ -97,7 +97,12 @@ namespace SafeExamBrowser.Contracts.Configuration public string DownloadDirectory { get; set; } /// - /// The copyright information for the application (i.e. the executing assembly). + /// The build version of the application. + /// + public string ProgramBuildVersion { get; set; } + + /// + /// The copyright information for the application. /// public string ProgramCopyright { get; set; } @@ -107,14 +112,14 @@ namespace SafeExamBrowser.Contracts.Configuration public string ProgramDataFilePath { get; set; } /// - /// The program title of the application (i.e. the executing assembly). + /// The program title of the application. /// public string ProgramTitle { get; set; } /// - /// The program version of the application (i.e. the executing assembly). + /// The informational version of the application. /// - public string ProgramVersion { get; set; } + public string ProgramInformationalVersion { get; set; } /// /// The communication address of the runtime component. diff --git a/SafeExamBrowser.Contracts/I18n/TextKey.cs b/SafeExamBrowser.Contracts/I18n/TextKey.cs index 0c1cacdc..063db73e 100644 --- a/SafeExamBrowser.Contracts/I18n/TextKey.cs +++ b/SafeExamBrowser.Contracts/I18n/TextKey.cs @@ -16,6 +16,7 @@ namespace SafeExamBrowser.Contracts.I18n { BrowserWindow_DeveloperConsoleMenuItem, BrowserWindow_ZoomMenuItem, + Build, LogWindow_Title, MessageBox_ApplicationError, MessageBox_ApplicationErrorTitle, diff --git a/SafeExamBrowser.I18n/Text.xml b/SafeExamBrowser.I18n/Text.xml index d98e523e..921d9595 100644 --- a/SafeExamBrowser.I18n/Text.xml +++ b/SafeExamBrowser.I18n/Text.xml @@ -1,309 +1,312 @@  - - Developer Console - - - Page Zoom - - - Application Log - - - An unrecoverable error has occurred! Please consult the application log for more information. The application will now shut down... - - - Application Error - - - Cancel - - - The local client configuration has failed! Please consult the application log for more information. The application will now shut down... - - - Client Configuration Error - - - The client configuration has been saved and will be used when you start the application the next time. Do you want to quit for now? - - - Configuration Successful - - - Failed to download the new application configuration. Please try again or contact technical support. - - - Download Error - - - The configuration resource "%%URI%%" contains invalid data! - - - Configuration Error - - - You failed to enter the correct password within 5 attempts. The application will now terminate... - - - Invalid Password - - - The application can only be terminated by entering the correct quit password. - - - Invalid Quit Password - - - No - - - The configuration resource "%%URI%%" is not supported! - - - Configuration Error - - - OK - - - Do you want to quit the application? - - - Quit? - - - The client failed to communicate the shutdown request to the runtime! - - - Quit Error - - - You are not allowed to reconfigure the application. - - - Reconfiguration Denied - - - The client failed to communicate the reconfiguration request to the runtime! - - - Reconfiguration Error - - - Would you like to reconfigure the application? - - - Configuration Detected - - - Would you like to reload the current page? - - - Reload? - - - Failed to initialize the SEB service! The application will now terminate since the service is configured to be mandatory. - - - Service Unavailable - - - Failed to initialize the SEB service. The application will continue initialization since the service is configured to be optional. - - - Service Unavailable - - - The application failed to start a new session! Please consult the application log for more information... - - - Session Start Error - - - An unexpected error occurred during the shutdown procedure! Please consult the application log for more information... - - - Shutdown Error - - - An unexpected error occurred during the startup procedure! Please consult the application log for more information... - - - Startup Error - - - An unexpected error occurred while trying to load configuration resource "%%URI%%"! Please consult the application log for more information... - - - Configuration Error - - - Yes - - - Information about SEB - - - Application Log - - - Closing runtime connection - - - Emptying clipboard - - - Finalizing service session - - - Initializing browser - - - Initializing application configuration - - - Initializing kiosk mode - - - Initializing process monitoring - - - Initializing runtime connection - - - Initializing service session - - - Initializing new session - - - Initializing user interface - - - Initializing window monitoring - - - Initializing working area - - - Restarting communication host - - - Restoring working area - - - Reverting kiosk mode - - - Starting client - - - Starting communication host - - - Starting keyboard interception - - - Starting mouse interception - - - Stopping client - - - Stopping communication host - - - Stopping keyboard interception - - - Stopping mouse interception - - - Stopping process monitoring - - - Stopping window monitoring - - - Terminating browser - - - Terminating user interface - - - Waiting for Windows explorer to start up - - - Waiting for Windows explorer to shut down - - - Waiting for the runtime to disconnect - - - Cancel - - - Confirm - - - Please enter the administrator password for the local client configuration: - - - Administrator Password Required - - - Please enter the settings password for the local client configuration: - - - Settings Password Required - - - Please enter the quit password in order to terminate the application: - - - Quit Password Required - - - Please enter the settings password for the selected application configuration: - - - Settings Password Required - - - The application is running. - - - Terminate Session - - - Plugged in, charging... (%%CHARGE%%%) - - - Fully charged (%%CHARGE%%%) - - - The battery charge is critically low. Please connect your computer to a power supply! - - - The battery charge is getting low. Consider connecting your computer to a power supply in time... - - - %%HOURS%%h %%MINUTES%%min remaining (%%CHARGE%%%) - - - The current keyboard layout is "%%LAYOUT%%" - - - Connected to "%%NAME%%" - - - Disconnected - - - No wireless network adapter available or turned on - - - Version - + + Developer Console + + + Page Zoom + + + Build + + + Application Log + + + An unrecoverable error has occurred! Please consult the application log for more information. The application will now shut down... + + + Application Error + + + Cancel + + + The local client configuration has failed! Please consult the application log for more information. The application will now shut down... + + + Client Configuration Error + + + The client configuration has been saved and will be used when you start the application the next time. Do you want to quit for now? + + + Configuration Successful + + + Failed to download the new application configuration. Please try again or contact technical support. + + + Download Error + + + The configuration resource "%%URI%%" contains invalid data! + + + Configuration Error + + + You failed to enter the correct password within 5 attempts. The application will now terminate... + + + Invalid Password + + + The application can only be terminated by entering the correct quit password. + + + Invalid Quit Password + + + No + + + The configuration resource "%%URI%%" is not supported! + + + Configuration Error + + + OK + + + Do you want to quit the application? + + + Quit? + + + The client failed to communicate the shutdown request to the runtime! + + + Quit Error + + + You are not allowed to reconfigure the application. + + + Reconfiguration Denied + + + The client failed to communicate the reconfiguration request to the runtime! + + + Reconfiguration Error + + + Would you like to reconfigure the application? + + + Configuration Detected + + + Would you like to reload the current page? + + + Reload? + + + Failed to initialize the SEB service! The application will now terminate since the service is configured to be mandatory. + + + Service Unavailable + + + Failed to initialize the SEB service. The application will continue initialization since the service is configured to be optional. + + + Service Unavailable + + + The application failed to start a new session! Please consult the application log for more information... + + + Session Start Error + + + An unexpected error occurred during the shutdown procedure! Please consult the application log for more information... + + + Shutdown Error + + + An unexpected error occurred during the startup procedure! Please consult the application log for more information... + + + Startup Error + + + An unexpected error occurred while trying to load configuration resource "%%URI%%"! Please consult the application log for more information... + + + Configuration Error + + + Yes + + + Information about SEB + + + Application Log + + + Closing runtime connection + + + Emptying clipboard + + + Finalizing service session + + + Initializing browser + + + Initializing application configuration + + + Initializing kiosk mode + + + Initializing process monitoring + + + Initializing runtime connection + + + Initializing service session + + + Initializing new session + + + Initializing user interface + + + Initializing window monitoring + + + Initializing working area + + + Restarting communication host + + + Restoring working area + + + Reverting kiosk mode + + + Starting client + + + Starting communication host + + + Starting keyboard interception + + + Starting mouse interception + + + Stopping client + + + Stopping communication host + + + Stopping keyboard interception + + + Stopping mouse interception + + + Stopping process monitoring + + + Stopping window monitoring + + + Terminating browser + + + Terminating user interface + + + Waiting for Windows explorer to start up + + + Waiting for Windows explorer to shut down + + + Waiting for the runtime to disconnect + + + Cancel + + + Confirm + + + Please enter the administrator password for the local client configuration: + + + Administrator Password Required + + + Please enter the settings password for the local client configuration: + + + Settings Password Required + + + Please enter the quit password in order to terminate the application: + + + Quit Password Required + + + Please enter the settings password for the selected application configuration: + + + Settings Password Required + + + The application is running. + + + Terminate Session + + + Plugged in, charging... (%%CHARGE%%%) + + + Fully charged (%%CHARGE%%%) + + + The battery charge is critically low. Please connect your computer to a power supply! + + + The battery charge is getting low. Consider connecting your computer to a power supply in time... + + + %%HOURS%%h %%MINUTES%%min remaining (%%CHARGE%%%) + + + The current keyboard layout is "%%LAYOUT%%" + + + Connected to "%%NAME%%" + + + Disconnected + + + No wireless network adapter available or turned on + + + Version + \ No newline at end of file diff --git a/SafeExamBrowser.Runtime/CompositionRoot.cs b/SafeExamBrowser.Runtime/CompositionRoot.cs index fb6f6c76..94109151 100644 --- a/SafeExamBrowser.Runtime/CompositionRoot.cs +++ b/SafeExamBrowser.Runtime/CompositionRoot.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Reflection; using SafeExamBrowser.Communication.Hosts; @@ -106,7 +107,7 @@ namespace SafeExamBrowser.Runtime internal void LogStartupInformation() { - logger.Log($"/* {appConfig.ProgramTitle}, Version {appConfig.ProgramVersion}"); + logger.Log($"/* {appConfig.ProgramTitle}, Version {appConfig.ProgramInformationalVersion}, Build {appConfig.ProgramBuildVersion}"); logger.Log($"/* {appConfig.ProgramCopyright}"); logger.Log($"/* "); logger.Log($"/* Please visit https://www.github.com/SafeExamBrowser for more information."); @@ -125,6 +126,7 @@ namespace SafeExamBrowser.Runtime private void InitializeConfiguration() { var executable = Assembly.GetExecutingAssembly(); + var programBuild = FileVersionInfo.GetVersionInfo(executable.Location).FileVersion; var programCopyright = executable.GetCustomAttribute().Copyright; var programTitle = executable.GetCustomAttribute().Title; var programVersion = executable.GetCustomAttribute().InformationalVersion; @@ -143,6 +145,7 @@ namespace SafeExamBrowser.Runtime new HashAlgorithm(), repositoryLogger, executable.Location, + programBuild, programCopyright, programTitle, programVersion); diff --git a/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml b/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml index 7383e522..907883c5 100644 --- a/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml +++ b/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml @@ -17,7 +17,7 @@ - + This application is subject to the terms of the Mozilla Public License, version 2.0. If a copy of the MPL was not diff --git a/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml.cs index 82e2dbd4..3b6d8e6b 100644 --- a/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/AboutWindow.xaml.cs @@ -8,6 +8,7 @@ using System.Windows; using System.Windows.Documents; +using System.Windows.Media; using SafeExamBrowser.Contracts.Configuration; using SafeExamBrowser.Contracts.I18n; using SafeExamBrowser.Contracts.UserInterface.Windows; @@ -44,10 +45,12 @@ namespace SafeExamBrowser.UserInterface.Desktop private void InitializeAboutWindow() { Closing += (o, args) => closing?.Invoke(); - VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Version)} {appConfig.ProgramVersion}") { FontStyle = FontStyles.Italic }); + VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Version)} {appConfig.ProgramInformationalVersion}") { FontSize = 12 }); + VersionInfo.Inlines.Add(new LineBreak()); + VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Build)} {appConfig.ProgramBuildVersion}") { FontSize = 8, Foreground = Brushes.Gray }); VersionInfo.Inlines.Add(new LineBreak()); VersionInfo.Inlines.Add(new LineBreak()); - VersionInfo.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10 }); + VersionInfo.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10, Foreground = Brushes.Gray }); } } } diff --git a/SafeExamBrowser.UserInterface.Desktop/RuntimeWindow.xaml b/SafeExamBrowser.UserInterface.Desktop/RuntimeWindow.xaml index 8859c749..19825e6d 100644 --- a/SafeExamBrowser.UserInterface.Desktop/RuntimeWindow.xaml +++ b/SafeExamBrowser.UserInterface.Desktop/RuntimeWindow.xaml @@ -46,7 +46,7 @@ - + - + This application is subject to the terms of the Mozilla Public License, version 2.0. If a copy of the MPL was not diff --git a/SafeExamBrowser.UserInterface.Mobile/AboutWindow.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/AboutWindow.xaml.cs index bc3f2420..1bb2e79b 100644 --- a/SafeExamBrowser.UserInterface.Mobile/AboutWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/AboutWindow.xaml.cs @@ -8,6 +8,7 @@ using System.Windows; using System.Windows.Documents; +using System.Windows.Media; using SafeExamBrowser.Contracts.Configuration; using SafeExamBrowser.Contracts.I18n; using SafeExamBrowser.Contracts.UserInterface.Windows; @@ -44,10 +45,12 @@ namespace SafeExamBrowser.UserInterface.Mobile private void InitializeAboutWindow() { Closing += (o, args) => closing?.Invoke(); - VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Version)} {appConfig.ProgramVersion}") { FontStyle = FontStyles.Italic }); + VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Version)} {appConfig.ProgramInformationalVersion}") { FontSize = 12 }); + VersionInfo.Inlines.Add(new LineBreak()); + VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Build)} {appConfig.ProgramBuildVersion}") { FontSize = 8, Foreground = Brushes.Gray }); VersionInfo.Inlines.Add(new LineBreak()); VersionInfo.Inlines.Add(new LineBreak()); - VersionInfo.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10 }); + VersionInfo.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10, Foreground = Brushes.Gray }); } } } diff --git a/SafeExamBrowser.UserInterface.Mobile/RuntimeWindow.xaml b/SafeExamBrowser.UserInterface.Mobile/RuntimeWindow.xaml index 7bc9534f..8ac480da 100644 --- a/SafeExamBrowser.UserInterface.Mobile/RuntimeWindow.xaml +++ b/SafeExamBrowser.UserInterface.Mobile/RuntimeWindow.xaml @@ -46,7 +46,7 @@ - +