-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateElvUI.bat
66 lines (58 loc) · 1.88 KB
/
updateElvUI.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
set versionOLD= 0
REM Exit if the config file isn't there
if not exist wowpath.cfg (
msg * Your wowpath.cfg isn't there SUKA!
PAUSE
exit
)
set /p WOWPath= < wowpath.cfg
REM Exit if the Path to WOW doesnt exist
if not exist "%WOWPath%" (
msg * Ding Dong your wowpath is wrong!
PAUSE
exit
)
REM If ElvUI is installed check the toc file for the installed version number
if exist %WOWPath%/ElvUI/ElvUI.toc (
powershell -Command "Select-String -Path '%wowPath%\ElvUI\ElvUI.toc' -Pattern 'Version\: ([0-9]+.[0-9]+)' -AllMatches | %% { $_.Matches.Groups[1] } | %% { $_.Value } | Out-File tmpfile -Encoding ascii -NoNewline"
set /p versionOLD= <tmpfile
del tmpfile
)
powershell -Command "Invoke-WebRequest https://www.tukui.org/download.php?ui=elvui#version -OutFile elvui.html"
if errorlevel 1 (
echo Error appeared, try again
del elvui.html
exit
)
powershell -Command "Select-String -Path elvui.html -Pattern '<b class=""Premium"""">([0-9]+.[0-9]+)</b>' -AllMatches | %% { $_.Matches.Groups[1] } | %% { $_.Value } | Out-File tmpfile -Encoding ascii -NoNewline"
if errorlevel 1 (
echo Error appeared, try again
del tmpfile
exit
)
set /p version= < tmpfile
del tmpfile
if %versionOLD% LSS %version% (
if not exist "elvui-%version%.zip" (
powershell -Command "Invoke-WebRequest https://www.tukui.org/downloads/elvui-%version%.zip -OutFile elvui-%version%.zip"
if errorlevel 1 (
echo Error appeared, try again
del elvui-%version%.zip
exit
)
)
powershell.exe -NoP -NonI -Command "Expand-Archive -Path '%CD%\elvui-%version%.zip' -DestinationPath '%wowPath%' -Force"
if errorlevel 1 (
echo Error appeared, try again
del elvui-%version%.zip
exit
)
echo Installed ElvUI version %version% succesfully
PAUSE
exit
) else (
msg * Newest ElvUI version is already downloaded and installed BLYAT!
PAUSE
exit
)