-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.bat
68 lines (54 loc) · 1.31 KB
/
update.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
:: >>> LICENSED BY CIRO D.
:: Original file name: update.bat
:: LICENSE: MOZILLA PUBLIC LICENSE
@ECHO OFF
COLOR F
TITLE Launcher: Updating
ECHO # OpenCraft Updater
ECHO ; NOTE: Make sure to do a cleanup before
ECHO ; updating OpenCraft. And if you
ECHO ; have modified OpenCraft, many things
ECHO ; can go wrong.
SET/p "UPDPKG=Select the location of the package: "
Echo # Processing...
IF NOT EXIST %UPDPKG% (
echo.
Echo # That file doesn't exists!
Echo # Update failed!
TITLE Launcher: Update failed
EXIT/b
)
SET/p "CONFIRM=Type 'Yes' to continue: "
IF "%CONFIRM%" NEQ "Yes" (
echo.
Echo # Update cancelled
TITLE Launcher: Update cancelled
EXIT/b
)
REM Before starting updating process
REM We will clean the temporary folder
DEL/f/s/q %IM_TEMP% > NUL
echo.
Echo # Starting update process...
COPY/y %UPDPKG% %IM_TEMP%\package.tar.gz
CHDIR/d %IM_TEMP%
Echo # Decompressing package...
echo.
%GZIP_PATH% -vd package.tar.gz
echo.
Echo # Package decompressed!
Echo # Extracting package content...
echo.
%TAR_PATH% -xvf package.tar
echo.
DEL/f/q package.tar > NUL
Echo # Extracted package contents...
Echo # Deleted package.tar!
echo.
@REM Execute applier file
start /wait /b applier.bat
cd..
echo.
Echo # Update finished!
TITLE Launcher: Update complete
EXIT/b