fix updater crash on windows

This commit is contained in:
marco
2019-06-15 17:42:01 +02:00
parent e4493ea30e
commit a0d0c9e855

View File

@@ -52,6 +52,8 @@ def check_addon_init():
pos = n
break
else:
# evitiamo che dia errore perchè il file è già in uso
localCommitFile.close()
updateFromZip()
return True
@@ -207,13 +209,12 @@ def updateFromZip():
logger.info("kodiondemand.core.updater descomprime fichero...")
destpathname = xbmc.translatePath("special://home/addons/")
logger.info("kodiondemand.core.updater destpathname=%s" % destpathname)
unzipper = ziptools()
unzipper.extract(localfilename, destpathname)
# puliamo tutto
shutil.rmtree(addonDir)
unzipper = ziptools()
unzipper.extract(localfilename, destpathname)
filetools.rename(destpathname + "addon-" + branch, addonDir)
# Borra el zip descargado