mirror of
https://github.com/fofolee/uTools-ProcessKiller.git
synced 2025-12-22 18:22:17 +08:00
win增加内存排序、显示用户名功能
This commit is contained in:
22
preload.js
22
preload.js
@@ -1,18 +1,15 @@
|
||||
const os = require('os')
|
||||
const iconv = require('iconv-lite')
|
||||
const { spawn, exec } = require("child_process")
|
||||
|
||||
//-------checkUpdate------
|
||||
const fs = require('fs')
|
||||
const path = require("path")
|
||||
const { dialog, BrowserWindow, nativeImage } = require('electron').remote
|
||||
const { shell } = require('electron');
|
||||
const path = require("path")
|
||||
|
||||
|
||||
isWin = os.platform() == 'win32' ? true : false;
|
||||
|
||||
getIco = isWin ? require('icon-extractor') : require('file-icon');
|
||||
|
||||
totalMem = os.totalmem();
|
||||
|
||||
getLogo = () => nativeImage.createFromPath(path.join(__dirname, 'logo.png'));
|
||||
pluginInfo = JSON.parse(fs.readFileSync(path.join(__dirname, 'plugin.json')));
|
||||
logo = nativeImage.createFromPath(path.join(__dirname, 'logo.png'));
|
||||
|
||||
messageBox = (options, callback) => {
|
||||
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), options, index => {
|
||||
@@ -23,6 +20,13 @@ messageBox = (options, callback) => {
|
||||
open = url => {
|
||||
shell.openExternal(url);
|
||||
}
|
||||
// ------------------------
|
||||
|
||||
isWin = os.platform() == 'win32' ? true : false;
|
||||
|
||||
getIco = isWin ? require('icon-extractor') : require('file-icon');
|
||||
|
||||
totalMem = os.totalmem();
|
||||
|
||||
powershell = (cmd, callback) => {
|
||||
const ps = spawn('powershell', ['-Command', cmd], { encoding: 'buffer' })
|
||||
|
||||
Reference in New Issue
Block a user