diff --git a/setup.py b/setup.py index 611ac50..7046199 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text() setup( name='worthless', - version='2.2.3', + version='2.2.4', packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'], url='https://git.froggi.es/tretrauit/worthless-launcher', license='MIT License', diff --git a/worthless/installer.py b/worthless/installer.py index cc1875c..57c5cbf 100644 --- a/worthless/installer.py +++ b/worthless/installer.py @@ -413,8 +413,13 @@ class Installer: archive = Path(archive).resolve() if not archive.exists(): raise FileNotFoundError(f"'{archive}' not found") - with zipfile.ZipFile(archive, 'r') as f: - await asyncio.to_thread(f.extractall, path=self._gamedir) + print(f'-o"{str(self._gamedir)}"') + proc = await asyncio.create_subprocess_shell(f"7z x {str(archive)} -o'{str(self._gamedir)}'") + await proc.wait() + if proc.returncode != 0: + raise RuntimeError("Extracting failed") + # with zipfile.ZipFile(archive, 'r') as f: + # await asyncio.to_thread(f.extractall, path=self._gamedir) async def apply_voiceover(self, voiceover_archive: str | Path): # Since Voiceover packages are unclear about diff package or full package