-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate.py
30 lines (30 loc) · 1.35 KB
/
update.py
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
import zipfile
import os
from distutils.dir_util import copy_tree
from shutil import copyfile
try :
with zipfile.ZipFile("update/updatefile.zip","r") as zip_ref:
zip_ref.extractall("update/updatefile")
except :
print("ERROR : Failed to extract zip.")
try :
copy_tree("update/updatefile/RGX-4.0-Python-master/Songs", "Songs")
print("SUCESS : Successfully updated Songs")
copy_tree("update/updatefile/RGX-4.0-Python-master/img", "img")
print("SUCESS : Successfully updated img")
copy_tree("update/updatefile/RGX-4.0-Python-master/music", "music")
print("SUCESS : Successfully updated music")
copy_tree("update/updatefile/RGX-4.0-Python-master/ttf", "ttf")
print("SUCESS : Successfully updated ttf")
copy_tree("update/updatefile/RGX-4.0-Python-master/etc", "etc")
print("SUCESS : Successfully updated etc")
copyfile("update/updatefile/RGX-4.0-Python-master/main.py", "main.py")
print("SUCESS : Successfully updated main.py")
copyfile("update/updatefile/RGX-4.0-Python-master/version.txt", "version.txt")
print("SUCESS : Successfully updated version.txt")
copyfile("update/updatefile/RGX-4.0-Python-master/SongData.zip", "SongData.zip")
print("SUCESS : Successfully updated SongData.zip")
except :
print("ERROR : Failed to Copy Updated File")
print("FILE UPDATED SUCCESSFULLY!")
os.system('main.py')