Update app.js and relative files

This commit is contained in:
Namhyeon Go 2020-07-21 15:14:14 +09:00
parent 908a49f7ee
commit 02c56bec32
6 changed files with 39 additions and 20 deletions

2
app.js
View File

@ -90,7 +90,7 @@ function require(FN) {
// make global function
FSO = null;
T = "(function(global){\n" + '"use strict";' + "var module={exports:{}};var exports={};\n" + T + "\nmodule.exports=exports;return module.exports;})(this);\n\n////@ sourceURL=" + FN;
T = "(function(global,module,exports){\n" + '"use strict";' + T + "\nmodule.exports=exports;return module.exports;})(this,{exports:{}},{});\n\n////@ sourceURL=" + FN;
try {
cache[FN] = eval(T);
} catch (e) {

25
bootstrap.js vendored Normal file
View File

@ -0,0 +1,25 @@
//////////////////////////////////////////////////////////////////////////////////
//
// bootstrap.js
//
/////////////////////////////////////////////////////////////////////////////////
var PS = require("lib/powershell");
var REG = require("lib/registry");
return {
main: function() {
// unlock file
console.log("Starting unlock files...");
PS.execCommand("dir | Unblock-File");
// import necessary registry
REG.importFromFile("app/assets/reg/Allow_ADO_CORS.reg");
//REG.importFromFile("app/assets/reg/Add_URI_Scheme.reg");
// register URI scheme
// todo
console.log("done");
}
};

View File

@ -2,6 +2,8 @@
// Registry API
////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
exports.VERSIONINFO = "Registry Module (registry.js) version 0.1";
exports.global = global;
exports.require = global.require;
@ -71,6 +73,7 @@ exports.destroy = function(hKey, path, key, computer) {
return reg.DeleteKey(hKey, loc);
}
/*
// DEPRECATED
exports.create = function(hiveKey, path, key, computer) {
console.log("Warning! Registry.create method is DEPRECATED.");
@ -110,13 +113,14 @@ exports.create = function(hiveKey, path, key, computer) {
var createRet = reg.ExecMethod_(createKey.Name, createArgs);
return createRet.returnValue == 0;
}
*/
exports.import = function(scriptName) {
exports.importFromFile = function(fileName) {
var arguments = [];
arguments.push("reg");
arguments.push("import");
arguments.push(scriptName + ".reg");
arguments.push(fileName);
return SHELL.exec(arguments.join(' '));
};

View File

@ -1,6 +1,6 @@
@echo off
cscript app.js unlockfile
cscript app.js bootstrap
start app.hta &

View File

@ -1,12 +0,0 @@
var PS = require("lib/powershell");
//var REGISTRY = require("lib/registry");
return {
main: function() {
console.log("Starting unlock files...");
PS.execCommand("dir | Unblock-File");
//REGISTRY.import("app\\assets\\reg\\Add_URI_Scheme");
//REGISTRY.import("app\\assets\\reg\\Allow_ADO_CORS");
console.log("done");
}
};

View File

@ -1,7 +1,9 @@
/*
* uriloader.js
*/
//////////////////////////////////////////////////////////////////////////////////
//
// uriloader.js
//
/////////////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
return {