mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
Update uriloader.js
This commit is contained in:
parent
793d8d84ac
commit
f133bbe04a
70
uriloader.js
70
uriloader.js
|
@ -14,85 +14,103 @@ exports.main = function(args) {
|
|||
if (pos < 0) {
|
||||
console.log("Not vaild URI scheme");
|
||||
} else {
|
||||
var cmd = [],
|
||||
var commands = [],
|
||||
queryString = uri.substring(pos + 4),
|
||||
query = URI.parseQueryString(queryString);
|
||||
|
||||
if (!query.application) {
|
||||
if (!query.application)
|
||||
query.application = "";
|
||||
}
|
||||
|
||||
switch (query.application) {
|
||||
case "app":
|
||||
cmd.push("start");
|
||||
cmd.push("/d");
|
||||
cmd.push(SYS.getCurrentScriptDirectory());
|
||||
cmd.push("app.hta");
|
||||
cmd.push(uri); // passing URI to application
|
||||
commands.push([
|
||||
"start",
|
||||
"/d",
|
||||
SYS.getCurrentScriptDirectory(),
|
||||
"app.hta",
|
||||
uri
|
||||
]);
|
||||
break;
|
||||
|
||||
case "mscalc":
|
||||
cmd.push("calc.exe");
|
||||
commands.push([
|
||||
"calc.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "msie":
|
||||
//cmd.push("%PROGRAMFILES%\\Internet Explorer\\iexplore.exe");
|
||||
//cmd.push("https://github.com/gnh1201/welsonjs");
|
||||
WINLIBS.loadLibrary("url").call("FileProtocolHandler", [
|
||||
"https://github.com/gnh1201/welsonjs"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "msexcel":
|
||||
cmd.push("%PROGRAMFILES%\\Microsoft Office\\Office15\\EXCEL.EXE");
|
||||
commands.push([
|
||||
"%PROGRAMFILES%\\Microsoft Office\\Office15\\EXCEL.EXE"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "mspowerpoint":
|
||||
cmd.push("%PROGRAMFILES%\\Microsoft Office\\Office15\\POWERPNT.EXE");
|
||||
commands.push([
|
||||
"%PROGRAMFILES%\\Microsoft Office\\Office15\\POWERPNT.EXE"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "msword":
|
||||
cmd.push("%PROGRAMFILES%\\Microsoft Office\\Office15\\WINWORD.EXE");
|
||||
commands.push([
|
||||
"%PROGRAMFILES%\\Microsoft Office\\Office15\\WINWORD.EXE"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "msaccess":
|
||||
cmd.push("%PROGRAMFILES%\\Microsoft Office\\Office15\\MSACCESS.EXE");
|
||||
commands.push([
|
||||
"%PROGRAMFILES%\\Microsoft Office\\Office15\\MSACCESS.EXE"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "ldmultiplayer":
|
||||
cmd.push("%SYSTEMDRIVE%\\LDPlayer\LDPlayer3.0\\dnmultiplayer.exe");
|
||||
commands.push([
|
||||
"%SYSTEMDRIVE%\\LDPlayer\LDPlayer3.0\\dnmultiplayer.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "noxmultiplayer":
|
||||
cmd.push("%PROGRAMFILES(X86)%\\Nox\\bin\\MultiPlayerManager.exe");
|
||||
commands.push([
|
||||
"%PROGRAMFILES(X86)%\\Nox\\bin\\MultiPlayerManager.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "codingschool":
|
||||
cmd.push("%PROGRAMFILES(X86)\\CodingSchool3\\CodingSchool3.exe");
|
||||
//cmd.push(SYS.getCurrentScriptDirectory() + "\\bin\\CodingSchool\\CodingSchool.exe");
|
||||
commands.push([
|
||||
"%PROGRAMFILES(X86)\\CodingSchool3\\CodingSchool3.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "arduino":
|
||||
cmd.push("%PROGRAMFILES(X86)%\\Arduino\\arduino.exe");
|
||||
commands.push([
|
||||
"%PROGRAMFILES(X86)%\\Arduino\\arduino.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "opentyping":
|
||||
cmd.push(SYS.getCurrentScriptDirectory() + "\\bin\\OpenTyping\\OpenTyping.exe");
|
||||
commands.push([
|
||||
SYS.getCurrentScriptDirectory() + "\\bin\\OpenTyping\\OpenTyping.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
case "hnctt80":
|
||||
cmd.push("%PROGRAMFILES(X86)%\\HNC\\HncTT80\\HncTT.exe");
|
||||
commands.push([
|
||||
"%PROGRAMFILES(X86)%\\HNC\\HncTT80\\HncTT.exe"
|
||||
]);
|
||||
break;
|
||||
|
||||
dafault:
|
||||
console.log("Unknown application");
|
||||
}
|
||||
|
||||
if (typeof(query.args) !== "undefined") {
|
||||
cmd.push(query.args);
|
||||
if (commands.length > 0) {
|
||||
SHELL.run(commands.pop());
|
||||
}
|
||||
|
||||
SHELL.run(cmd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user