fixed pyinstaller 7z unpacking issues, replaced pyunpack with patoolib

This commit is contained in:
k4yt3x
2020-05-12 06:31:18 -04:00
parent 180bfcab20
commit 1be2c1ead7
4 changed files with 90 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ import zipfile
# later in the script.
# import requests
VERSION = '2.0.0'
VERSION = '2.0.1'
# global static variables
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
@@ -230,6 +230,11 @@ class Video2xSetup:
anime4kcpp_7z = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(anime4kcpp_7z)
# if running in PyInstaller, add sys._MEIPASS\7z to path
# this directory contains 7za.exe and its DLL files
with contextlib.suppress(AttributeError):
os.environ['PATH'] += f';{sys._MEIPASS}\\7z'
# (LOCALAPPDATA / 'video2x' / 'anime4kcpp').mkdir(parents=True, exist_ok=True)
# pyunpack.Archive(anime4kcpp_7z).extractall(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
if (LOCALAPPDATA / 'video2x' / 'anime4kcpp').exists():