Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/windows-release/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
'use strict'; const os = require('os'); const execa = require('execa'); // Reference: https://www.gaijin.at/en/lstwinver.php const names = new Map([ ['10.0', '10'], ['6.3', '8.1'], ['6.2', '8'], ['6.1', '7'], ['6.0', 'Vista'], ['5.2', 'Server 2003'], ['5.1', 'XP'], ['5.0', '2000'], ['4.9', 'ME'], ['4.1', '98'], ['4.0', '95'] ]); const windowsRelease = release => { const version = /\d+\.\d/.exec(release || os.release()); if (release && !version) { throw new Error('`release` argument doesn\'t match `n.n`'); } const ver = (version || [])[0]; // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) { let stdout; try { stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || ''; } catch { stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || ''; } const year = (stdout.match(/2008|2012|2016|2019/) || [])[0]; if (year) { return `Server ${year}`; } } return names.get(ver); }; module.exports = windowsRelease;