mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update lib/std.js, bootstrap.js
This commit is contained in:
parent
52f2134c20
commit
ea41064aed
14
bootstrap.js
vendored
14
bootstrap.js
vendored
|
@ -4,11 +4,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var STD = require("lib/std");
|
||||
var PS = require("lib/powershell");
|
||||
var REG = require("lib/registry");
|
||||
var SYS = require("lib/system");
|
||||
var SHELL = require("lib/shell");
|
||||
//var UPDATER = require("lib/updater");
|
||||
|
||||
var appName = "welsonjs";
|
||||
|
||||
|
@ -33,10 +33,6 @@ exports.main = function(args) {
|
|||
REG.write(REG.HKCR, appName + "\\DefaultIcon", "", SYS.getCurrentScriptDirectory() + "\\app\\favicon.ico,0", REG.STRING);
|
||||
REG.write(REG.HKCR, appName + "\\shell\\open\\command", "", "cmd.exe /c cscript " + SYS.getCurrentScriptDirectory() + "\\app.js uriloader \"%1\"", REG.STRING);
|
||||
|
||||
// check updates
|
||||
//console.log("Checking updates...");
|
||||
//UPDATER.checkUpdates();
|
||||
|
||||
// open web application
|
||||
console.log("Trying open GUI...");
|
||||
|
||||
|
@ -46,9 +42,11 @@ exports.main = function(args) {
|
|||
try {
|
||||
var process = processList[i];
|
||||
if (process.Caption == "mshta.exe") {
|
||||
console.warn("Will be kill process ID:", process.ProcessID);
|
||||
SYS.killProcess(process.ProcessID);
|
||||
sleep(1000);
|
||||
//console.warn("Will be kill process ID:", process.ProcessID);
|
||||
//SYS.killProcess(process.ProcessID);
|
||||
//sleep(1000);
|
||||
STD.alert("Please close the running application (PID: " + process.processID + ")");
|
||||
return 0;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e.message);
|
||||
|
|
|
@ -288,6 +288,10 @@ function CreateObject(progId, serverName, callback) {
|
|||
}
|
||||
};
|
||||
|
||||
function alert(msg) {
|
||||
CreateObject("WScript.Shell").Popup(msg);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Standard Event Object
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -367,3 +371,4 @@ exports.require = global.require;
|
|||
|
||||
exports.Event = StdEvent;
|
||||
exports.EventableObject = StdEventableObject;
|
||||
exports.alert = alert;
|
||||
|
|
Loading…
Reference in New Issue
Block a user