2025-01-09 05:05:48 +00:00
|
|
|
REM WelsonJS 0.2.7 bootstrapping script
|
|
|
|
REM Source code available: https://github.com/gnh1201/welsonjs
|
2025-01-09 04:58:48 +00:00
|
|
|
|
2021-09-21 11:59:57 +00:00
|
|
|
@echo off
|
|
|
|
pushd %~dp0
|
2024-07-22 19:26:38 +00:00
|
|
|
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Define variables
|
|
|
|
set TOOLKIT_URL=https://ics.catswords.net/welsonjs_toolkit.cab
|
|
|
|
set TOOLKIT_PATH=%TEMP%\welsonjs_toolkit.cab
|
|
|
|
set TOOLKIT_EXTRACT_PATH=%TEMP%
|
|
|
|
set REGASM_PATH=%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
|
2025-01-09 07:03:00 +00:00
|
|
|
set LOCAL_TOOLKIT_DLL=bin\x86\WelsonJS.Toolkit.dll
|
|
|
|
set DOWNLOADED_TOOLKIT_DLL=%TEMP%\WelsonJS.Toolkit.dll
|
2025-01-09 04:58:48 +00:00
|
|
|
|
|
|
|
echo [*] Initializing WelsonJS pre-configuration...
|
2024-07-22 19:26:38 +00:00
|
|
|
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Register HTA file association
|
|
|
|
echo [*] Configuring HTA file association...
|
2024-07-22 19:26:38 +00:00
|
|
|
reg import app\assets\reg\Default_HTA.reg
|
|
|
|
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Unlock performance limit for MSHTML
|
|
|
|
echo [*] Unlocking MSHTML performance limits...
|
2024-07-22 19:26:38 +00:00
|
|
|
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
|
|
|
|
|
2025-01-09 07:03:00 +00:00
|
|
|
:: Determine which toolkit to use
|
|
|
|
if exist "%LOCAL_TOOLKIT_DLL%" (
|
|
|
|
echo [*] Local toolkit found. Using "%LOCAL_TOOLKIT_DLL%" for registration.
|
|
|
|
set TOOLKIT_DLL=%LOCAL_TOOLKIT_DLL%
|
|
|
|
) else if exist "%DOWNLOADED_TOOLKIT_DLL%" (
|
|
|
|
echo [*] Downloaded toolkit found. Using "%DOWNLOADED_TOOLKIT_DLL%" for registration.
|
|
|
|
set TOOLKIT_DLL=%DOWNLOADED_TOOLKIT_DLL%
|
2025-01-09 04:58:48 +00:00
|
|
|
) else (
|
2025-01-09 07:03:00 +00:00
|
|
|
echo [*] Toolkit not found locally. Downloading from external source...
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Download the latest WelsonJS.Toolkit component
|
|
|
|
bitsadmin /transfer toolkit_download /download /priority normal %TOOLKIT_URL% %TOOLKIT_PATH%
|
|
|
|
|
|
|
|
:: Extract the downloaded CAB file
|
|
|
|
echo [*] Extracting WelsonJS.Toolkit component...
|
2025-01-09 05:03:13 +00:00
|
|
|
expand %TOOLKIT_PATH% -F:* %TOOLKIT_EXTRACT_PATH%
|
2025-01-09 07:03:00 +00:00
|
|
|
|
|
|
|
:: Set the downloaded DLL as the target
|
|
|
|
set TOOLKIT_DLL=%DOWNLOADED_TOOLKIT_DLL%
|
2025-01-09 04:58:48 +00:00
|
|
|
)
|
2024-07-22 19:26:38 +00:00
|
|
|
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Register the WelsonJS.Toolkit component
|
2024-08-15 08:47:29 +00:00
|
|
|
echo [*] Registering WelsonJS.Toolkit component...
|
2025-01-09 04:58:48 +00:00
|
|
|
%REGASM_PATH% /codebase %TOOLKIT_DLL%
|
2024-07-22 19:26:38 +00:00
|
|
|
|
2025-01-09 04:58:48 +00:00
|
|
|
:: Final step
|
|
|
|
echo [*] Pre-configuration complete. Starting bootstrap script...
|
2021-09-21 11:59:57 +00:00
|
|
|
cscript app.js bootstrap
|