forked from YARC-Official/YARG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
91 lines (64 loc) · 2.75 KB
/
install.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
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
# pip install requests
import requests, zipfile, io, os, shutil
PATH = os.path.dirname(os.path.realpath(__file__))
DEST_PATH = f"{PATH}/../Assets/Plugins/BassNative"
URL = "https://www.un4seen.com/files/"
def download(name, prefix=""):
req = requests.get(f"{URL}/{prefix}{name}")
zip = zipfile.ZipFile(io.BytesIO(req.content))
zip.extractall(f"{PATH}/{name}")
def move(start, to):
shutil.copy(f"{PATH}/{start}", f"{DEST_PATH}/{to}")
# Check if we are in the repo
if not os.path.exists(DEST_PATH):
print("You are not in the YARG repo. Make sure you keep the script in the `InstallLibraries` folder.")
exit()
# Delete old stuff
if os.path.exists(f"{PATH}/../Assets/Libraries"):
shutil.rmtree(f"{PATH}/../Assets/Libraries")
# Install BASS
download("bass24.zip")
move("bass24.zip/bass.dll", "Windows/x86/bass.dll")
move("bass24.zip/x64/bass.dll", "Windows/x86_64/bass.dll")
download("bass24-linux.zip")
move("bass24-linux.zip/libs/x86_64/libbass.so", "Linux/x86_64/libbass.so")
download("bass24-osx.zip")
move("bass24-osx.zip/libbass.dylib", "Mac/libbass.dylib")
# Install BASSOPUS
download("bassopus24.zip")
move("bassopus24.zip/bassopus.dll", "Windows/x86/bassopus.dll")
move("bassopus24.zip/x64/bassopus.dll", "Windows/x86_64/bassopus.dll")
download("bassopus24-linux.zip")
move("bassopus24-linux.zip/libs/x86_64/libbassopus.so", "Linux/x86_64/libbassopus.so")
download("bassopus24-osx.zip")
move("bassopus24-osx.zip/libbassopus.dylib", "Mac/libbassopus.dylib")
# Install BASSmix
download("bassmix24.zip")
move("bassmix24.zip/bassmix.dll", "Windows/x86/bassmix.dll")
move("bassmix24.zip/x64/bassmix.dll", "Windows/x86_64/bassmix.dll")
download("bassmix24-linux.zip")
move("bassmix24-linux.zip/libs/x86_64/libbassmix.so", "Linux/x86_64/libbassmix.so")
download("bassmix24-osx.zip")
move("bassmix24-osx.zip/libbassmix.dylib", "Mac/libbassmix.dylib")
# Install BASS FX
download("bass_fx24.zip", "z/0/")
move("bass_fx24.zip/bass_fx.dll", "Windows/x86/bass_fx.dll")
move("bass_fx24.zip/x64/bass_fx.dll", "Windows/x86_64/bass_fx.dll")
download("bass_fx24-linux.zip", "z/0/")
move("bass_fx24-linux.zip/libs/x86_64/libbass_fx.so", "Linux/x86_64/libbass_fx.so")
download("bass_fx24-osx.zip", "z/0/")
move("bass_fx24-osx.zip/libbass_fx.dylib", "Mac/libbass_fx.dylib")
# Clean up
shutil.rmtree(f"{PATH}/bass24.zip")
shutil.rmtree(f"{PATH}/bass24-linux.zip")
shutil.rmtree(f"{PATH}/bass24-osx.zip")
shutil.rmtree(f"{PATH}/bassopus24.zip")
shutil.rmtree(f"{PATH}/bassopus24-linux.zip")
shutil.rmtree(f"{PATH}/bassopus24-osx.zip")
shutil.rmtree(f"{PATH}/bassmix24.zip")
shutil.rmtree(f"{PATH}/bassmix24-linux.zip")
shutil.rmtree(f"{PATH}/bassmix24-osx.zip")
shutil.rmtree(f"{PATH}/bass_fx24.zip")
shutil.rmtree(f"{PATH}/bass_fx24-linux.zip")
shutil.rmtree(f"{PATH}/bass_fx24-osx.zip")
print("Done!")