add bios serial for windows

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>

Simon Smith committed Oct 4, 2023 at 18:51 UTC 14c3816fc90375e70348ee88f2fd81db6f03fdbf
3 files changed +6
agents/meshcore.js
+4
@@ -1825,6 +1825,10 @@ function getSystemInformation(func) {
1825 if (results.hardware.windows.osinfo) { delete results.hardware.windows.osinfo.Node; }
1826 if (results.hardware.windows.partitions) { for (var i in results.hardware.windows.partitions) { delete results.hardware.windows.partitions[i].Node; } }
1827 } catch (ex) { }
1828 + try {
1829 + var values = require('win-wmi').query('ROOT\\CIMV2', "SELECT * FROM Win32_Bios", ['SerialNumber']);
1830 + results.hardware.identifiers['bios_serial'] = values[0]['SerialNumber'];
1831 + } catch (ex) { }
1832 }
1833 results.hardware.agentvers = process.versions;
1834 replaceSpacesWithUnderscoresRec(results);
views/default-mobile.handlebars
+1
@@ -5969,6 +5969,7 @@
5969 // BIOS
5970 if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); }
5971 if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); }
5972 + if (ident.bios_serial) { x += addDetailItem("Serial", EscapeHtml(ident.bios_serial), s); }
5973 if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip' }); }
5974
5975 // Motherboard
views/default.handlebars
+1
@@ -11654,6 +11654,7 @@
11654 // BIOS
11655 if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); }
11656 if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); }
11657 + if (ident.bios_serial) { x += addDetailItem("Serial", EscapeHtml(ident.bios_serial), s); }
11658 if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip64.png' }); }
11659
11660 // Motherboard