-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdater.py
27 lines (24 loc) · 985 Bytes
/
updater.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
# Messenger Update Tool
__author__ = "Sam Scott"
__email__ = "samueltscott@gmail.com"
repo = "https://github.com/Nytra/messenger"
from urllib import request
import zipfile, io, os
def update():
try:
print("Downloading repository...")
r = request.urlopen("https://github.com/Nytra/messenger/archive/master.zip")
print("Extracting...")
with zipfile.ZipFile(io.BytesIO(r.read())) as z:
z.extractall()
print("Moving files...")
cmd = "move \"{}\\messenger-master\\*\" \"{}\"".format(os.path.abspath(""), os.path.abspath(""))
os.system(cmd)
cmd = "rmdir \"{}\\messenger-master\"".format(os.path.abspath(""))
print("Cleaning up...")
os.system(cmd)
input("Installation complete.\n\nPress enter to quit . . .")
except:
print("An error occurred during the installation procedure. Your files may be corrupt.")
if __name__ == "__main__":
update()