Skip to content

Commit ae6c76f

Browse files
authored
v4.13 - fix TLS issue with PowerShell
1 parent 1f098f2 commit ae6c76f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

updater.bat

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ TITLE arkenfox user.js updater
33

44
REM ## arkenfox user.js updater for Windows
55
REM ## author: @claustromaniac
6-
REM ## version: 4.12
6+
REM ## version: 4.13
77
REM ## instructions: https://github.com/arkenfox/user.js/wiki/3.3-Updater-Scripts
88

9-
SET v=4.12
9+
SET v=4.13
1010

1111
VERIFY ON
1212
CD /D "%~dp0"
@@ -51,9 +51,7 @@ IF DEFINED _updateb (
5151
CALL :message "Updating script..."
5252
REM Uncomment the next line and comment out the PowerShell call for testing.
5353
REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul
54-
(
55-
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat', '[updated]!_myname!.bat')"
56-
) >nul 2>&1
54+
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat "[updated]!_myname!.bat"
5755
IF EXIST "[updated]!_myname!.bat" (
5856
START /min CMD /C "[updated]!_myname!.bat" !_myparams!
5957
) ELSE (
@@ -132,9 +130,7 @@ IF DEFINED _log (
132130
)
133131
IF EXIST user.js.new (DEL /F "user.js.new")
134132
CALL :message "Retrieving latest user.js file from github repository..."
135-
(
136-
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/user.js', 'user.js.new')"
137-
) >nul 2>&1
133+
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/user.js "user.js.new"
138134
IF EXIST user.js.new (
139135
IF DEFINED _rfpalts (
140136
CALL :message "Activating RFP Alternatives section..."
@@ -218,6 +214,13 @@ IF NOT "2"=="%_log%" (ECHO:)
218214
ENDLOCAL
219215
GOTO :EOF
220216

217+
::::::::::::: Download :::::::::::::
218+
:psdownload
219+
(
220+
PowerShell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('%~1', '%~2')"
221+
) >nul 2>&1
222+
GOTO :EOF
223+
221224
::::::::::::::: Activate Section :::::::::::::::
222225
:activate
223226
:: arg1 = file

0 commit comments

Comments
 (0)