diff --git a/lib/autoit.js b/lib/autoit.js index 7dd966d..4e5f5c6 100644 --- a/lib/autoit.js +++ b/lib/autoit.js @@ -39,7 +39,7 @@ function AutoItObject() { if (this.interface != null) { try { - //this.interface[functionName].apply(args); + //this.interface[functionName].apply(null, args); eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")"); } catch (e) { console.error("AutoItObject.callFunction() ->", e.message); diff --git a/lib/powershell.js.bak b/lib/powershell.js.bak index 54b8056..8b13789 100644 --- a/lib/powershell.js.bak +++ b/lib/powershell.js.bak @@ -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"); -}; diff --git a/registerDLLs.bat b/registerDLLs.bat new file mode 100644 index 0000000..05cdec3 --- /dev/null +++ b/registerDLLs.bat @@ -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 \ No newline at end of file