7
7
"""
8
8
9
9
10
+
10
11
import contextlib
11
12
import sys
12
13
import zipfile
13
14
import os
14
15
import shutil
15
16
import win32file
16
17
import requests
18
+ import json
17
19
from rich .console import Console
18
20
19
21
console = Console ()
27
29
games_in_cur_dir = [
28
30
file
29
31
for file in files
30
- if file .endswith (".exe" ) and os .path .exists (file .replace (".exe" , "" ) + "_Data" )
32
+ if file .endswith (".exe" )
33
+ and os .path .exists (file .replace (".exe" , "" ) + "_Data" )
31
34
]
32
35
match len (games_in_cur_dir ):
33
36
case 0 :
34
- console .print ("You have to specify the games exe file. " ,
37
+ console .print ("Automatic Detection could not find any Game in the current Directory " ,
35
38
style = "red on black" )
36
39
input ("Press Enter to continue..." )
37
40
sys .exit (0 )
49
52
input ("Press Enter to continue..." )
50
53
sys .exit (0 )
51
54
52
- BEPINEXIL2CPP64 = "https://builds.bepinex.dev/projects/bepinex_be/577/BepInEx_UnityIL2CPP_x64_ec79ad0_6.0.0-be.577.zip"
53
- BEPINEXIL2CPP86 = "https://builds.bepinex.dev/projects/bepinex_be/577/BepInEx_UnityIL2CPP_x86_ec79ad0_6.0.0-be.577.zip"
54
- BEPINEX64 = "https://github.com/BepInEx/BepInEx/releases/download/v5.4.21/BepInEx_x64_5.4.21.0.zip"
55
- BEPINEX86 = "https://github.com/BepInEx/BepInEx/releases/download/v5.4.21/BepInEx_x86_5.4.21.0.zip"
56
- BEPINEX6IL2CPP64 = "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityIL2CPP_x64_6.0.0-pre.1.zip"
57
- BEPINEX6IL2CPP86 = "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityIL2CPP_x86_6.0.0-pre.1.zip"
58
- BEPINEX664 = "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityMono_x64_6.0.0-pre.1.zip"
59
- BEPINEX686 = "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityMono_x86_6.0.0-pre.1.zip"
60
- BEPINEXBEBUILD64 = "https://builds.bepinex.dev/projects/bepinex_be/668/BepInEx-Unity.Mono-win-x64-6.0.0-be.668%2B46e297f.zip"
61
- BEPINEXBEBUILD86 = "https://builds.bepinex.dev/projects/bepinex_be/668/BepInEx-Unity.Mono-win-x86-6.0.0-be.668%2B46e297f.zip"
62
- BEPINEXBEBUILDIL2CPP64 = "https://builds.bepinex.dev/projects/bepinex_be/668/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.668%2B46e297f.zip"
63
- BEPINEXBEBUILDIL2CPP86 = "https://builds.bepinex.dev/projects/bepinex_be/668/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.668%2B46e297f.zip"
55
+ if os .path .isfile ("AutoInstaller-config.json" ):
56
+ with open ("AutoInstaller-config.json" , "r" ) as Config :
57
+ links = json .load (Config )
58
+ else :
59
+ links = {
60
+ "BEPINEXIL2CPP64" : "https://builds.bepinex.dev/projects/bepinex_be/577/BepInEx_UnityIL2CPP_x64_ec79ad0_6.0.0-be.577.zip" ,
61
+ "BEPINEXIL2CPP86" : "https://builds.bepinex.dev/projects/bepinex_be/577/BepInEx_UnityIL2CPP_x86_ec79ad0_6.0.0-be.577.zip" ,
62
+ "BEPINEX64" : "https://github.com/BepInEx/BepInEx/releases/download/v5.4.21/BepInEx_x64_5.4.21.0.zip" ,
63
+ "BEPINEX86" : "https://github.com/BepInEx/BepInEx/releases/download/v5.4.21/BepInEx_x86_5.4.21.0.zip" ,
64
+ "BEPINEX6IL2CPP64" : "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityIL2CPP_x64_6.0.0-pre.1.zip" ,
65
+ "BEPINEX6IL2CPP86" : "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityIL2CPP_x86_6.0.0-pre.1.zip" ,
66
+ "BEPINEX664" : "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityMono_x64_6.0.0-pre.1.zip" ,
67
+ "BEPINEX686" : "https://github.com/BepInEx/BepInEx/releases/download/v6.0.0-pre.1/BepInEx_UnityMono_x86_6.0.0-pre.1.zip" ,
68
+ "BEPINEXBEBUILD64" : "https://builds.bepinex.dev/projects/bepinex_be/670/BepInEx-Unity.Mono-win-x64-6.0.0-be.670%2B42a6727.zip" ,
69
+ "BEPINEXBEBUILD86" : "https://builds.bepinex.dev/projects/bepinex_be/670/BepInEx-Unity.Mono-win-x86-6.0.0-be.670%2B42a6727.zip" ,
70
+ "BEPINEXBEBUILDIL2CPP64" : "https://builds.bepinex.dev/projects/bepinex_be/670/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.670%2B42a6727.zip" ,
71
+ "BEPINEXBEBUILDIL2CPP86" : "https://builds.bepinex.dev/projects/bepinex_be/670/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.670%2B42a6727.zip" ,
72
+ "UNIVERSALUNITYDEMOSAIC" : "https://github.com/ManlyMarco/UniversalUnityDemosaics/releases/download/v1.5/UniversalUnityDemosaics_BepInEx5_v1.5.zip" ,
73
+ "UNIVERSALUNITYDEMOSAICIL2CPP" : "https://github.com/ManlyMarco/UniversalUnityDemosaics/releases/download/v1.5/UniversalUnityDemosaics_BepInEx6_IL2CPP_v1.5.zip" ,
74
+ "AUTOTRANSLATOR" : "https://github.com/bbepis/XUnity.AutoTranslator/releases/download/v5.0.0/XUnity.AutoTranslator-BepInEx-5.0.0.zip" ,
75
+ "AUTOTRANSLATORIL2CPP" : "https://github.com/bbepis/XUnity.AutoTranslator/releases/download/v5.0.0/XUnity.AutoTranslator-BepInEx-IL2CPP-5.0.0.zip" ,
76
+ "UNITYEXPLORERBE5" : "https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip" ,
77
+ "UNITYEXPLORERBE5IL2CPP" : "https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx.Il2Cpp.zip" ,
78
+ "UNITYEXPLORERBE6" : "https://github.com/sinai-dev/UnityExplorer/releases/download/4.9.0/UnityExplorer.BepInEx6.Mono.zip" ,
79
+ "UNITYEXPLORERBE6IL2CPP" : "https://github.com/sinai-dev/UnityExplorer/releases/download/4.9.0/UnityExplorer.BepInEx.IL2CPP.zip" ,
80
+ "TEXTUREREPLACER" : "https://attachments.f95zone.to/2023/06/2692158_Texture_Replacer_plugin_v1.0.5.1.zip"
81
+ }
82
+ with open ("AutoInstaller-config.json" , "w" ) as Config :
83
+ json .dump (links , Config )
64
84
65
85
def determine_arch () -> str :
66
86
il2cpp = bool (os .path .isfile ("GameAssembly.dll" ))
@@ -95,7 +115,7 @@ def download_universaldemosaic():
95
115
os .mkdir ("Bepinex/plugins" )
96
116
if arch in ["mono_64" , "mono_86" ]:
97
117
install_universaldemosaic_9 (
98
- "https://github.com/ManlyMarco/UniversalUnityDemosaics/releases/download/v1.5/UniversalUnityDemosaics_BepInEx5_v1.5.zip" ,
118
+ links [ "UNIVERSALUNITYDEMOSAIC" ] ,
99
119
"DumbRendererDemosaic.dll" ,
100
120
)
101
121
os .system ("del DumbTypeDemosaic.dll" )
@@ -104,7 +124,7 @@ def download_universaldemosaic():
104
124
os .system ("del CombinedMeshDemosaic.dll" )
105
125
elif arch in ["il2cpp_64" , "il2cpp_86" ]:
106
126
install_universaldemosaic_9 (
107
- "https://github.com/ManlyMarco/UniversalUnityDemosaics/releases/download/v1.5/UniversalUnityDemosaics_BepInEx6_IL2CPP_v1.5.zip" ,
127
+ links [ "UNIVERSALUNITYDEMOSAICIL2CPP" ] ,
108
128
"DumbRendererDemosaicIl2Cpp.dll" ,
109
129
)
110
130
else :
@@ -126,19 +146,19 @@ def download_bepinex6():
126
146
style = "yellow on black" )
127
147
return
128
148
if arch == "il2cpp_64" :
129
- download_url (BEPINEX6IL2CPP64 , "Bepinex.zip" )
149
+ download_url (links [ " BEPINEX6IL2CPP64" ] , "Bepinex.zip" )
130
150
unzip ("Bepinex.zip" )
131
151
os .system ("del Bepinex.zip" )
132
152
elif arch == "il2cpp_86" :
133
- download_url (BEPINEX6IL2CPP86 , "Bepinex.zip" )
153
+ download_url (links [ " BEPINEX6IL2CPP86" ] , "Bepinex.zip" )
134
154
unzip ("Bepinex.zip" )
135
155
os .system ("del Bepinex.zip" )
136
156
elif arch == "mono_64" :
137
- download_url (BEPINEX664 , "Bepinex.zip" )
157
+ download_url (links [ " BEPINEX664" ] , "Bepinex.zip" )
138
158
unzip ("Bepinex.zip" )
139
159
os .system ("del Bepinex.zip" )
140
160
elif arch == "mono_86" :
141
- download_url (BEPINEX686 , "Bepinex.zip" )
161
+ download_url (links [ " BEPINEX686" ] , "Bepinex.zip" )
142
162
unzip ("Bepinex.zip" )
143
163
os .system ("del Bepinex.zip" )
144
164
else :
@@ -152,19 +172,19 @@ def download_bepinex():
152
172
style = "yellow on black" )
153
173
return
154
174
if arch == "mono_64" :
155
- download_url (BEPINEX64 , "Bepinex.zip" )
175
+ download_url (links [ " BEPINEX64" ] , "Bepinex.zip" )
156
176
unzip ("Bepinex.zip" )
157
177
os .system ("del Bepinex.zip" )
158
178
elif arch == "mono_86" :
159
- download_url (BEPINEX86 , "Bepinex.zip" )
179
+ download_url (links [ " BEPINEX86" ] , "Bepinex.zip" )
160
180
unzip ("Bepinex.zip" )
161
181
os .system ("del Bepinex.zip" )
162
182
elif arch == "il2cpp_64" :
163
- download_url (BEPINEXIL2CPP64 , "Bepinex.zip" )
183
+ download_url (links [ " BEPINEXIL2CPP64" ] , "Bepinex.zip" )
164
184
unzip ("Bepinex.zip" )
165
185
os .system ("del Bepinex.zip" )
166
186
elif arch == "il2cpp_86" :
167
- download_url (BEPINEXIL2CPP86 , "Bepinex.zip" )
187
+ download_url (links [ " BEPINEXIL2CPP86" ] , "Bepinex.zip" )
168
188
unzip ("Bepinex.zip" )
169
189
os .system ("del Bepinex.zip" )
170
190
else :
@@ -184,11 +204,11 @@ def download_autotranslator():
184
204
return
185
205
if arch in ["mono_64" , "mono_86" ]:
186
206
install_autotranslator_7 (
187
- "https://github.com/bbepis/XUnity.AutoTranslator/releases/download/v5.0.0/XUnity.AutoTranslator-BepInEx-5.0.0.zip"
207
+ links [ "AUTOTRANSLATOR" ]
188
208
)
189
209
elif arch in ["il2cpp_64" , "il2cpp_86" ]:
190
210
install_autotranslator_7 (
191
- "https://github.com/bbepis/XUnity.AutoTranslator/releases/download/v5.0.0/XUnity.AutoTranslator-BepInEx-IL2CPP-5.0.0.zip"
211
+ links [ "AUTOTRANSLATORIL2CPP" ]
192
212
)
193
213
else :
194
214
sys .exit ("Something went wrong***" )
@@ -208,13 +228,13 @@ def download_unityexplorer():
208
228
try :
209
229
if arch in ["mono_64" , "mono_86" ]:
210
230
install_unityexplorer_8 (
211
- "https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip" ,
231
+ links [ "UNITYEXPLORERBE5" ] ,
212
232
"plugins/sinai-dev-UnityExplorer/" ,
213
233
"plugins" ,
214
234
)
215
235
elif arch in ["il2cpp_64" , "il2cpp_86" ]:
216
236
install_unityexplorer_8 (
217
- "https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx.Il2Cpp.zip" ,
237
+ links [ "UNITYEXPLORERBE5IL2CPP" ] ,
218
238
"UnityExplorer.BepInEx.IL2CPP/plugins/sinai-dev-UnityExplorer/" ,
219
239
"UnityExplorer.BepInEx.IL2CPP" ,
220
240
)
@@ -240,19 +260,19 @@ def install_BEBuild6():
240
260
console .print ("Bepinex is already installed!" , style = "yellow on black" )
241
261
return
242
262
if arch == "mono_64" :
243
- download_url (BEPINEXBEBUILD64 , "Bepinex.zip" )
263
+ download_url (links [ " BEPINEXBEBUILD64" ] , "Bepinex.zip" )
244
264
unzip ("Bepinex.zip" )
245
265
os .system ("del Bepinex.zip" )
246
266
elif arch == "mono_86" :
247
- download_url (BEPINEXBEBUILD86 , "Bepinex.zip" )
267
+ download_url (links [ " BEPINEXBEBUILD86" ] , "Bepinex.zip" )
248
268
unzip ("Bepinex.zip" )
249
269
os .system ("del Bepinex.zip" )
250
270
elif arch == "il2cpp_64" :
251
- download_url (BEPINEXBEBUILDIL2CPP64 , "Bepinex.zip" )
271
+ download_url (links [ " BEPINEXBEBUILDIL2CPP64" ] , "Bepinex.zip" )
252
272
unzip ("Bepinex.zip" )
253
273
os .system ("del Bepinex.zip" )
254
274
elif arch == "il2cpp_86" :
255
- download_url (BEPINEXBEBUILDIL2CPP86 , "Bepinex.zip" )
275
+ download_url (links [ " BEPINEXBEBUILDIL2CPP86" ] , "Bepinex.zip" )
256
276
unzip ("Bepinex.zip" )
257
277
os .system ("del Bepinex.zip" )
258
278
else :
@@ -265,13 +285,13 @@ def install_UnityExplorer6():
265
285
style = "yellow on black" )
266
286
return
267
287
if arch in ["mono_64" , "mono_86" ]:
268
- download_url ("https://github.com/sinai-dev/UnityExplorer/releases/download/4.9.0/UnityExplorer.BepInEx6.Mono.zip" , "UnityExplorer.zip" )
288
+ download_url (links [ "UNITYEXPLORERBE6" ] , "UnityExplorer.zip" )
269
289
unzip ("UnityExplorer.zip" )
270
290
os .system ("del UnityExplorer.zip" )
271
291
shutil .move ("plugins/sinai-dev-UnityExplorer" , "BepInEx/plugins" )
272
292
os .rmdir ("plugins" )
273
293
elif arch in ["il2cpp_64" , "il2cpp_86" ]:
274
- download_url ("https://github.com/sinai-dev/UnityExplorer/releases/download/4.9.0/UnityExplorer.BepInEx.IL2CPP.zip" , "UnityExplorer.zip" )
294
+ download_url (links [ "UNITYEXPLORERBE6IL2CPP" ] , "UnityExplorer.zip" )
275
295
unzip ("UnityExplorer.zip" )
276
296
os .system ("del UnityExplorer.zip" )
277
297
shutil .move ("UnityExplorer.BepInEx.IL2CPP/plugins/sinai-dev-UnityExplorer" , "BepInEx/plugins" )
@@ -287,15 +307,15 @@ def install_TextureReplacer():
287
307
style = "yellow on black" )
288
308
return
289
309
if arch in ["mono_64" , "mono_86" ]:
290
- download_url ("https://attachments.f95zone.to/2023/01/2332348_Texture_Replacer_v1.0.4.1.zip" , "Texture_Replacer.zip" )
310
+ download_url (links [ "TEXTUREREPLACER" ] , "Texture_Replacer.zip" )
291
311
unzip ("Texture_Replacer.zip" )
292
312
os .system ("del Texture_Replacer.zip" )
293
313
with contextlib .suppress (FileExistsError ):
294
314
os .mkdir ("BepInEx/plugins" )
295
315
shutil .move ("Texture_Replacer.dll" , "BepInEx/plugins" )
296
316
os .system ("del Texture_Replacer_il2cpp.dll" )
297
317
elif arch in ["il2cpp_64" , "il2cpp_86" ]:
298
- download_url ("https://attachments.f95zone.to/2023/01/2332348_Texture_Replacer_v1.0.4.1.zip" , "Texture_Replacer.zip" )
318
+ download_url (links [ "TEXTUREREPLACER" ] , "Texture_Replacer.zip" )
299
319
unzip ("Texture_Replacer.zip" )
300
320
os .system ("del Texture_Replacer.zip" )
301
321
with contextlib .suppress (FileExistsError ):
0 commit comments