From d15f23a3c131d10f612298475e5b8a6575b5fc29 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 23 Jul 2024 04:26:38 +0900 Subject: [PATCH] Update app.js and clean up files --- REGASM.MD | 20 --------------- app.js | 4 +-- .../assets/reg/Default_HTA.reg | Bin bootstrap.bat | 22 ++++++++++++++++ bootstrap.js | 2 +- preconfigure.bat | 24 ------------------ setup.iss | 4 +-- userid.txt | 1 - 8 files changed, 25 insertions(+), 52 deletions(-) delete mode 100644 REGASM.MD rename Default_HTA.reg => app/assets/reg/Default_HTA.reg (100%) delete mode 100644 preconfigure.bat delete mode 100644 userid.txt diff --git a/REGASM.MD b/REGASM.MD deleted file mode 100644 index 76f1278..0000000 --- a/REGASM.MD +++ /dev/null @@ -1,20 +0,0 @@ -# REGASM for WelsonJS - -In general, the location of REGASM is as follows. - -``` -C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe -``` - -Or it may vary depending on the version. - -## How to register .NET COM/DLL component - -Example: - -``` -C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll -C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll -``` - -Thank you. diff --git a/app.js b/app.js index 1e9a6af..3313ef3 100644 --- a/app.js +++ b/app.js @@ -44,8 +44,6 @@ // loaded. // var exit = function(status) { - if (status == 0) return; - console.error("Exit", status, "caused"); if (typeof WScript !== "undefined") { @@ -578,7 +576,7 @@ function initializeWindow(name, args, w, h) { if (app) { if (app.main) { var status = app.main.call(app, args); - if (status > -1) { + if (status > 0) { exit(status); } } else { diff --git a/Default_HTA.reg b/app/assets/reg/Default_HTA.reg similarity index 100% rename from Default_HTA.reg rename to app/assets/reg/Default_HTA.reg diff --git a/bootstrap.bat b/bootstrap.bat index 29db376..dcb8236 100644 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -1,3 +1,25 @@ @echo off +rem https://github.com/gnh1201/welsonjs + pushd %~dp0 + +echo [*] Starting pre-configure script... + +echo [*] Registering HTA file association... +reg import app\assets\reg\Default_HTA.reg + +echo [*] Unlocking the performance limit of MSHTML... +reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /f +reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /v "MaxScriptStatements" /t REG_DWORD /d 0xFFFFFFFF /f + +rem echo [*] Registering AutoItX component... +rem regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3.dll" +rem regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3_x64.dll" + +echo [*] Registering WelsonJS Toolkit component... +%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase bin\x86\WelsonJS.Toolkit.dll +%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase bin\x64\WelsonJS.Toolkit.dll + +echo [*] Done. + cscript app.js bootstrap diff --git a/bootstrap.js b/bootstrap.js index 1f0055d..6ba5ca5 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -25,7 +25,7 @@ exports.main = function(args) { // Register HTA file association console.log("Registering HTA file association..."); - REG.execFile("Default_HTA.reg"); + REG.execFile("app\\assets\\reg\\Default_HTA.reg"); // Register URI scheme if (!isDisabledRegisterURIScheme) { diff --git a/preconfigure.bat b/preconfigure.bat deleted file mode 100644 index 747b74c..0000000 --- a/preconfigure.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off -rem preconfigure.bat -rem Namhyeon Go (gnh1201@gmail.com) -rem https://github.com/gnh1201/welsonjs - -pushd %~dp0 -echo [*] Starting WelsonJS pre-configure script... - -echo [*] Registering HTA file association... -reg import Default_HTA.reg - -echo [*] Unlocking the performance limit of the GUI(MSHTML) environment... -reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /f -reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /v "MaxScriptStatements" /t REG_DWORD /d 0xFFFFFFFF /f - -echo [*] Registering AutoItX component... -regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3.dll" -regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3_x64.dll" - -echo [*] Registering WelsonJS native component... -%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase bin\x86\WelsonJS.Toolkit.dll -%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase bin\x64\WelsonJS.Toolkit.dll - -echo Done diff --git a/setup.iss b/setup.iss index fae1a98..243de50 100644 --- a/setup.iss +++ b/setup.iss @@ -1,5 +1,5 @@ ; @created_on 2020-06-26 -; @updated_on 2024-07-10 +; @updated_on 2024-07-23 ; @author Namhyeon Go (Catswords Research) [Setup] @@ -39,7 +39,6 @@ Source: "Default_HTA.reg"; DestDir: "{app}"; Source: "LICENSE"; DestDir: "{app}"; Source: "LICENSE_MSRL"; DestDir: "{app}"; Source: "*.md"; DestDir: "{app}"; -Source: "preconfigure.bat"; DestDir: "{app}"; Source: "bootstrap.bat"; DestDir: "{app}"; Source: "uriloader.js"; DestDir: "{app}"; Source: "webloader.js"; DestDir: "{app}"; @@ -63,7 +62,6 @@ Name: "{group}\Uninstall {cm:AppName}"; Filename: "{uninstallexe}"; AfterInstall ; Filename: {app}\bin\gtk2-runtime-2.24.33-2021-01-30-ts-win64.exe; ; Filename: {app}\bin\nmap-7.92\VC_redist.x86.exe; ; Filename: {app}\bin\nmap-7.92\npcap-1.50.exe; -Filename: {app}\preconfigure.bat; Filename: {app}\bootstrap.bat; [UninstallRun] diff --git a/userid.txt b/userid.txt deleted file mode 100644 index 56a6051..0000000 --- a/userid.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file