summaryrefslogtreecommitdiff
path: root/game/3rdparty/manaplus.rpy
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-07-18 23:01:29 -0300
committerJesusaves <cpntb1@ymail.com>2023-07-18 23:01:29 -0300
commita6849c2f44596e168c41332884c71ed254307a5a (patch)
tree5456c8584745a211421a01b8d2781ad47178481a /game/3rdparty/manaplus.rpy
parent5aa568124b438e68ba1f2d38f4ad7680e50853ab (diff)
downloadrenpy-a6849c2f44596e168c41332884c71ed254307a5a.tar.gz
renpy-a6849c2f44596e168c41332884c71ed254307a5a.tar.bz2
renpy-a6849c2f44596e168c41332884c71ed254307a5a.tar.xz
renpy-a6849c2f44596e168c41332884c71ed254307a5a.zip
Preserve client settings when updating. It looks clumsy but works better.
Diffstat (limited to 'game/3rdparty/manaplus.rpy')
-rw-r--r--game/3rdparty/manaplus.rpy17
1 files changed, 13 insertions, 4 deletions
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: