-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbootstrap.bat
52 lines (42 loc) · 1.95 KB
/
bootstrap.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
REM WelsonJS 0.2.7 bootstrapping script
REM Source code available: https://github.com/gnh1201/welsonjs
@echo off
pushd %~dp0
:: 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
set LOCAL_TOOLKIT_DLL=bin\x86\WelsonJS.Toolkit.dll
set DOWNLOADED_TOOLKIT_DLL=%TEMP%\WelsonJS.Toolkit.dll
echo [*] Initializing WelsonJS pre-configuration...
:: Register HTA file association
echo [*] Configuring HTA file association...
reg import app\assets\reg\Default_HTA.reg
:: Unlock performance limit for MSHTML
echo [*] Unlocking MSHTML performance limits...
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
:: 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%
) else (
echo [*] Toolkit not found locally. Downloading from external source...
:: 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...
expand %TOOLKIT_PATH% -F:* %TOOLKIT_EXTRACT_PATH%
:: Set the downloaded DLL as the target
set TOOLKIT_DLL=%DOWNLOADED_TOOLKIT_DLL%
)
:: Register the WelsonJS.Toolkit component
echo [*] Registering WelsonJS.Toolkit component...
%REGASM_PATH% /codebase %TOOLKIT_DLL%
:: Final step
echo [*] Pre-configuration complete. Starting bootstrap script...
cscript app.js bootstrap