add installedapps to console for windows

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2023-11-09 18:20:32 +00:00
parent ca64d11552
commit 12c3e4ee53

View File

@ -3733,6 +3733,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
if (bcdOK()) { availcommands += ',safemode'; }
if (require('notifybar-desktop').DefaultPinned != null) { availcommands += ',privacybar'; }
try { require('win-utils'); availcommands += ',taskbar'; } catch (ex) { }
try { require('win-info'); availcommands += ',installedapps'; } catch (ex) { }
}
if (amt != null) { availcommands += ',amt,amtconfig,amtevents'; }
if (process.platform != 'freebsd') { availcommands += ',vm'; }
@ -5035,6 +5036,12 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
}
break;
}
case 'installedapps': {
if(process.platform == 'win32'){
require('win-info').installedApps().then(function (apps){ sendConsoleText(JSON.stringify(apps,null,1)); });
}
break;
}
default: { // This is an unknown command, return an error message
response = "Unknown command \"" + cmd + "\", type \"help\" for list of available commands.";
break;