static void Main(string[] args) { // Calling RtlGetVersion in ntdll.dll // The Windows Kernel offers an interesting function. The RtlGetVersion routine returns version information about the // currently running operating system. It is available starting with Windows 2000 and also works on // Windows 10 / Server 2019 / Server 2016 right away. Console.WriteLine($"Windows version: " + $"{OSVersion.GetOSVersion().Version.Major}." + $"{OSVersion.GetOSVersion().Version.Minor}." + $"{OSVersion.GetOSVersion().Version.Build}" + $""); Console.WriteLine($"OS type: {OSVersion.GetOperatingSystem()}"); Console.WriteLine($"is workstation: {OSVersion.IsWorkstation}"); Console.WriteLine($"is server: {OSVersion.IsServer}"); Console.WriteLine($"64-Bit OS: {OSVersion.Is64BitOperatingSystem}"); if (OSVersion.GetOSVersion().Version.Major >= 10) { Console.WriteLine($"Windows Release ID: {OSVersion.MajorVersion10Properties().ReleaseId ?? "(Unable to detect)"}"); Console.WriteLine($"Windows Display Version: {OSVersion.MajorVersion10Properties().DisplayVersion ?? "(Unable to detect)"}"); Console.WriteLine($"Windows Update Build Revision: {OSVersion.MajorVersion10Properties().UBR ?? "(Unable to detect)"}"); } Console.ReadKey(); }
/// <summary> /// Check for hardware accelleration enablement (QuickSync). The result is stored in QuickSyncEncodingAvailable. /// </summary> public Handbrake(Log jobLog) : base("-i null -o null", (OSVersion.GetOSVersion() <= OSVersion.OS.WIN_2003 ? APP_PATH_XP : APP_PATH), new JobStatus(), jobLog, true) { _jobLog.WriteEntry(this, "Handbrake checking for OpenCL and QuickSync support", Log.LogEntryType.Information); _uiAdminSessionProcess = true; // This is a hardware enabled check Run(); _success = true; // We dont have output here, so assume we are good, do this AFTER calling Run since the exit code may be non zero _jobLog.WriteEntry(this, "QuickSync encoding supported availble -> " + quickSyncEnabled.ToString(), Log.LogEntryType.Information); }
public Handbrake(string Parameters, JobStatus jobStatus, Log jobLog, bool ignoreSuspend = false) : base(Parameters, (OSVersion.GetOSVersion() <= OSVersion.OS.WIN_2003 ? APP_PATH_XP : APP_PATH), jobStatus, jobLog, ignoreSuspend) { _uiAdminSessionProcess = true; // Always assume handbrake is running hardware API's, safety (no harm in running in UI session 1 always) _success = false; //Handbrake look for a +ve output in it's handlers so we start with a false }