mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 21:51:04 +00:00
Update lib/autoit.js, Create registerDLLs.bat
This commit is contained in:
parent
67d365026a
commit
82713e1588
|
@ -39,7 +39,7 @@ function AutoItObject() {
|
||||||
|
|
||||||
if (this.interface != null) {
|
if (this.interface != null) {
|
||||||
try {
|
try {
|
||||||
//this.interface[functionName].apply(args);
|
//this.interface[functionName].apply(null, args);
|
||||||
eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("AutoItObject.callFunction() ->", e.message);
|
console.error("AutoItObject.callFunction() ->", e.message);
|
||||||
|
|
|
@ -1,43 +1 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
// Powershell API
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
var SHELL = require("lib/shell");
|
|
||||||
|
|
||||||
exports.VERSIONINFO = "Powershell (powershell.js) version 0.1";
|
|
||||||
exports.global = global;
|
|
||||||
exports.require = global.require;
|
|
||||||
|
|
||||||
exports.execScript = function(scriptName, args) {
|
|
||||||
var cmd = [
|
|
||||||
"powershell.exe",
|
|
||||||
"-NoProfile",
|
|
||||||
"-ExecutionPolicy",
|
|
||||||
"ByPass",
|
|
||||||
"-nologo",
|
|
||||||
"-file",
|
|
||||||
scriptName + ".ps1"
|
|
||||||
];
|
|
||||||
|
|
||||||
if (typeof(cmd) !== "undefined") {
|
|
||||||
cmd = cmd.concat(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
return SHELL.exec(cmd);
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.execCommand = function(cmd) {
|
|
||||||
return SHELL.exec([
|
|
||||||
"powershell.exe",
|
|
||||||
"-NoProfile",
|
|
||||||
"-ExecutionPolicy",
|
|
||||||
"ByPass",
|
|
||||||
"-nologo",
|
|
||||||
"-Command",
|
|
||||||
"& {" + cmd + "}"
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.runAs = function(cmd) {
|
|
||||||
return exports.execCommand("Start-Process cmd \"/q /c " + SHELL.addslashes(SHELL.makeCmdLine(cmd)) + "\" -Verb RunAs");
|
|
||||||
};
|
|
||||||
|
|
6
registerDLLs.bat
Normal file
6
registerDLLs.bat
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
@echo off
|
||||||
|
regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3.dll"
|
||||||
|
regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3_x64.dll"
|
||||||
|
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
|
||||||
|
%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
|
||||||
|
pause
|
Loading…
Reference in New Issue
Block a user