diff options
Diffstat (limited to 'game/3rdparty')
-rw-r--r-- | game/3rdparty/builtin.rpy | 2 | ||||
-rw-r--r-- | game/3rdparty/manaplus.rpy | 17 | ||||
-rw-r--r-- | game/3rdparty/manaverse.rpy | 21 |
3 files changed, 29 insertions, 11 deletions
diff --git a/game/3rdparty/builtin.rpy b/game/3rdparty/builtin.rpy index c1ac566..6b4be34 100644 --- a/game/3rdparty/builtin.rpy +++ b/game/3rdparty/builtin.rpy @@ -19,7 +19,7 @@ init 1 python: return True ############################### - def cli_builtin(launch=False, download=True): + def cli_builtin(launch=False, download=True, force=False): global SCR_PROMPT, SCR_RESULT ########## if launch: diff --git a/game/3rdparty/manaplus.rpy b/game/3rdparty/manaplus.rpy index 39dba52..d9432df 100644 --- a/game/3rdparty/manaplus.rpy +++ b/game/3rdparty/manaplus.rpy @@ -45,7 +45,10 @@ init 1 python: def install_manaplus(): status_update("Creating ManaPlus directory...", 61) installdir=get_path("manaplus") - os.mkdir(installdir) + try: + os.mkdir(installdir) + except OSError: + pass ## Detect your plataform ######################################################### if renpy.linux: @@ -72,11 +75,15 @@ init 1 python: else: status_update("ERROR: Unsupported Plataform") return False - shutil.copytree(get_path('')+"Config", installdir+"/Config") + try: + shutil.copytree(get_path('')+"Config", installdir+"/Config") + except OSError: + traceback.print_exc() + pass return True ############################### - def cli_manaplus(launch=False, download=True): + def cli_manaplus(launch=False, download=True, force=False): global SCR_PROMPT, SCR_RESULT ## Check if ManaPlus is already installed try: @@ -97,10 +104,12 @@ init 1 python: if (not ret): return False + ## Actual download/installation (for updates) + if download and (force or not MANAPLUS): try: if not install_manaplus(): # Delete the failed attempt before raising the exception - shutil.rmtree(get_path("manaplus")) + #shutil.rmtree(get_path("manaplus")) #os.rmdir(get_path("manaplus")) raise Exception("Installation failed!") except: diff --git a/game/3rdparty/manaverse.rpy b/game/3rdparty/manaverse.rpy index a65da63..a639122 100644 --- a/game/3rdparty/manaverse.rpy +++ b/game/3rdparty/manaverse.rpy @@ -7,8 +7,8 @@ ################################################################################# ####### Constants -define manaverseWin64 = "https://manaplus.germantmw.de/manaplus/nightly/windows/manaverse.zip" -define manaverseLinux = "https://manaplus.germantmw.de/manaplus/nightly/linux/ManaPlus-x86_64.AppImage" +define manaverseWin64 = "https://updates.tmw2.org/mana/windows/manaverse.zip" +define manaverseLinux = "https://updates.tmw2.org/mana/linux/ManaPlus-x86_64.AppImage" ####### Main Code init 1 python: @@ -50,7 +50,10 @@ init 1 python: def install_manaverse(): status_update("Creating ManaPlus directory...", 61) installdir=get_path("manaplus") - os.mkdir(installdir) + try: + os.mkdir(installdir) + except OSError: + pass ## Detect your plataform ######################################################### if renpy.linux: @@ -85,11 +88,15 @@ init 1 python: else: status_update("ERROR: Unsupported Plataform") return False - shutil.copytree(get_path('')+"Config", installdir+"/Config") + try: + shutil.copytree(get_path('')+"Config", installdir+"/Config") + except OSError: + traceback.print_exc() + pass return True ############################### - def cli_manaverse(launch=False, download=True): + def cli_manaverse(launch=False, download=True, force=False): global SCR_PROMPT, SCR_RESULT ## Check if ManaPlus or ManaVerse is already installed try: @@ -110,10 +117,12 @@ init 1 python: if (not ret): return False + ## Actual download/installation (for updates) + if download and (force or not MANAPLUS): try: if not install_manaverse(): # Delete the failed attempt before raising the exception - shutil.rmtree(get_path("manaplus")) + #shutil.rmtree(get_path("manaplus")) #os.rmdir(get_path("manaplus")) raise Exception("Installation failed!") except: |