Skip to content

Commit

Permalink
added automatically disabling unitylibs if above 378
Browse files Browse the repository at this point in the history
  • Loading branch information
amydevs committed Jul 2, 2021
1 parent 5a297a8 commit d025e2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions modules/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, gameDirectory):
self.gameDirectory = gameDirectory
return

def install(self, bepinUrl):
def install(self, bepinUrl:str, installUnityLibs:bool):
print("The Default (Preferred) Version is Now 353. If you'd Like to Try Something Newer, Please Select A Newer Version.")
# Downloads BepInEx and extracts to Steam Library
print("\nDownloading and Installing BepInEx")
Expand All @@ -28,8 +28,9 @@ def install(self, bepinUrl):
bepinPath = os.path.join(self.gameDirectory, "BepInEx")

# Downloads Unity-Libs and extracts to Steam Library
print("\nDownloading and Extracting Unity Libraries")
self.utils.downloadFileAndUnzip(self.unitylibsutils.githubRawUrl, os.path.join(bepinPath, "unity-libs"))
if (installUnityLibs):
print("\nDownloading and Extracting Unity Libraries")
self.utils.downloadFileAndUnzip(self.unitylibsutils.githubRawUrl, os.path.join(bepinPath, "unity-libs"))

try:
DirectoryFiller(self.gameDirectory).fillWithBepinExFolders()
Expand Down
2 changes: 1 addition & 1 deletion srxdbepinexinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main():
print(f"Found BepInExURL: {url}")

# Run installer
installer.install(bepinUrl=url)
installer.install(bepinUrl=url, installUnityLibs=True)
try:
main()
except Exception as e:
Expand Down
5 changes: 4 additions & 1 deletion srxdbepinexinstallerui.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ class GUIWindow:
installerInstance = Installer(self.steamutils.gameDirectory)
installthread = None
if (not isUninstall and self.canInstall):
installUnityLibs = True
downloadUrl = self.bepinutils.downloadURLs[self.bepinutils.downloadVersions.index(self.selectedVersion.get())]
installthread = threading.Thread(target=installerInstance.install, args=(downloadUrl,), daemon=True).start()
if (int(self.selectedVersion.get()) >= 378):
installUnityLibs = False
installthread = threading.Thread(target=installerInstance.install, args=(downloadUrl, installUnityLibs), daemon=True).start()
elif (isUninstall):
installthread = threading.Thread(target=installerInstance.uninstall, daemon=True).start()
else:
Expand Down

0 comments on commit d025e2c

Please sign in to comment.