add installedapps to console for windows

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

si458 committed Nov 9, 2023 at 18:20 UTC 12c3e4ee53a6a8a4108e9a7946d6df60dcd7a280
1 file changed +7
agents/meshcore.js
+7
@@ -3733,6 +3733,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
3733 if (bcdOK()) { availcommands += ',safemode'; }
3734 if (require('notifybar-desktop').DefaultPinned != null) { availcommands += ',privacybar'; }
3735 try { require('win-utils'); availcommands += ',taskbar'; } catch (ex) { }
3736 + try { require('win-info'); availcommands += ',installedapps'; } catch (ex) { }
3737 }
3738 if (amt != null) { availcommands += ',amt,amtconfig,amtevents'; }
3739 if (process.platform != 'freebsd') { availcommands += ',vm'; }
@@ -5035,6 +5036,12 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
5036 }
5037 break;
5038 }
5039 + case 'installedapps': {
5040 + if(process.platform == 'win32'){
5041 + require('win-info').installedApps().then(function (apps){ sendConsoleText(JSON.stringify(apps,null,1)); });
5042 + }
5043 + break;
5044 + }
5045 default: { // This is an unknown command, return an error message
5046 response = "Unknown command \"" + cmd + "\", type \"help\" for list of available commands.";
5047 break;