Skip to content

Commit

Permalink
update clover
Browse files Browse the repository at this point in the history
  • Loading branch information
springkim committed Jul 19, 2018
1 parent 049834d commit 0c8fe64
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions install_clover.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ call :AbsoluteDownloadCurl
::start
title install_clover
cd %TEMP%
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $HTML=Invoke-WebRequest -Uri 'http://en.ejie.me/'; $HTML.Parsedhtml.getElementsByTagName('small') > clover_tags.txt"
powershell "get-content clover_tags.txt -ReadCount 1000 | foreach { $_ -match 'outerText' } | foreach { $_.Split(':')[1]} | out-file -encoding ascii clover_ver.txt"
call :AbsoluteDownloadHtmlAgilityPack

powershell "$wc = New-Object System.Net.WebClient;$html=$wc.DownloadString('http://en.ejie.me/');add-type -Path %WINDIR%\System32\HtmlAgilityPack.dll;$doc = New-Object HtmlAgilityPack.HtmlDocument;$doc.LoadHtml($html);$doc.DocumentNode.SelectSingleNode('html').SelectSingleNode('body').SelectSingleNode('div').SelectSingleNode('div').SelectSingleNode('div').SelectSingleNode('div').SelectSingleNode('div').InnerText -replace '\t','' > clover_tags.txt;"
powershell "get-content clover_tags.txt -ReadCount 1000 | foreach { $_ -match '^[0-9\.]+' | out-file -encoding ascii clover_ver.txt }"

set /p "VER="<"clover_ver.txt"
curlw -L "http://cn.ejie.me/uploads/setup_clover@%VER:~1%.exe" -o "%TEMP%\clover.exe"
curlw -L "http://cn.ejie.me/uploads/setup_clover@%VER%.exe" -o "%TEMP%\clover.exe"

echo Installing...
start /wait clover.exe /S
Expand All @@ -40,6 +43,7 @@ exit /b

::http://en.ejie.me/
::http://cn.ejie.me/uploads/[email protected]
::https://social.msdn.microsoft.com/Forums/en-US/eaadff1f-7bfc-49be-9e9a-3139c3dbe473/invoke-web-request-return-empty-parsed-html-field
::Download CURL
:GetFileSize
if exist %~1 set FILESIZE=%~z1
Expand All @@ -59,3 +63,11 @@ if %FILESIZE% neq 261889 (
goto :loop_adc2
)
exit /b
:AbsoluteDownloadHtmlAgilityPack
:loop_adhap
call :GetFileSize "%SystemRoot%\System32\HtmlAgilityPack.dll"
if %FILESIZE% neq 134656 (
powershell "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/s/bh8jras7at7m6lu/HtmlAgilityPack.dll?dl=1','%WINDIR%\System32\HtmlAgilityPack.dll')"
goto :loop_adhap
)
exit /b

0 comments on commit 0c8fe64

Please sign in to comment.