forked from C4G/BLIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_C4GBLIS_v3.3.bat
95 lines (79 loc) · 2.19 KB
/
update_C4GBLIS_v3.3.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@echo ON
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
set ts="%mydate%_%mytime%"
:checksumcheck
echo Updating to C4G BLIS v3.3... Please wait...
if not exist htdocs.zip goto failurezip
if not exist md5.exe goto failuremd
md5 -2BC35F41B66A6338EFE2FFBCD8B71588 htdocs.zip
IF ERRORLEVEL 1 goto checksumfailure
IF ERRORLEVEL 0 goto checksumsuccess
goto checkfailure
:updation
if not exist 7za.exe goto failureza
echo 7za.exe file exists
echo Backing up the present version of BLIS...
ren htdocs htdocs_backup_%ts%
if "%errorlevel%"=="1" goto failurefolder
echo Backup complete.
echo .
echo Starting C4G BLIS v3.3 source code update...
echo Extracting htdocs.zip...
7za x htdocs.zip -aoa>tmpFile2
if "%errorlevel%"=="1" goto extractionfailure
del tmpFile2
echo Code update complete.
goto success
:failuremd
echo md5.exe not found!
echo BLIS Update failed!
goto eof
:checksumsuccess
echo Update file verified to be correct.
goto updation
:checksumfailure
echo htdocs.zip file is corrupt!
echo Redownload the update files and start the update process again.
goto eof
:success
echo Creating Desktop Shortcut
xxmklink "C:\Users\%username%\Desktop\BLIS.lnk" "%cd%\BLIS.exe" "" "%cd%"
echo C4G BLIS updated Successfully to v3.3!
echo Starting C4G BLIS v3.3 ...
start BLIS.exe
goto eofExit
:failurezip
echo htdocs.zip not found!
echo BLIS Update failed!
goto eof
:failureza
echo 7za.exe not found!
echo BLIS Update failed!
goto eof
:failurefolder
echo htdocs folder not found!
echo BLIS Update Failed!
goto eof
:checkfailure
if exist del tmpFile2
echo Error occurred during file verification
echo BLIS Update Failed!
echo Try again.
echo If error persists, email [email protected] to report this error.
goto eof
:extractionfailure
if exist del tmpFile2
echo Error occurred during file extraction
echo BLIS Update Failed!
echo Try again.
echo If error persists, email [email protected] to report this error.
goto eof
:eof
if exist del tmpFile
if exist del tmpFile2
ping -n 100 -w 1000 0.0.0.1 > NUL
:eofExit
if exist del tmpFile
if exist del tmpFile2
exit