diff --git a/setup.py b/setup.py index a9e2f94..611ac50 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text() setup( name='worthless', - version='2.2.2', + version='2.2.3', 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/cli.py b/worthless/cli.py index 04a10a4..7932f72 100755 --- a/worthless/cli.py +++ b/worthless/cli.py @@ -336,6 +336,9 @@ async def main(): if args.from_ver: ui.override_game_version(args.from_ver) + if args.from_vo_ver: + ui.override_voiceover_version(args.from_ver) + if args.get_game_version: await ui.get_game_version() diff --git a/worthless/installer.py b/worthless/installer.py index 6e65b7a..cc1875c 100644 --- a/worthless/installer.py +++ b/worthless/installer.py @@ -60,7 +60,7 @@ class HDiffPatch: data_dir = Path(data_dir) self.data_path = Path(data_dir).joinpath("Tools/HDiffPatch") self.temp_path = data_dir.joinpath("Temp/HDiffPatch") - self.temp_path.mkdir(parents=True, exist_ok=True) + Path(self.temp_path).mkdir(parents=True, exist_ok=True) @staticmethod def _get_platform_arch(): @@ -350,14 +350,18 @@ class Installer: async def extract_and_patch(old_file, diff_file): diff_path = self.temp_path.joinpath(diff_file) if diff_path.is_file(): - await diff_path.unlink(missing_ok=True) - await asyncio.to_thread(archive.extract, diff_file, self.temp_path) + diff_path.unlink(missing_ok=True) + try: + print(diff_file) + await asyncio.to_thread(archive.extract, diff_file, self.temp_path) + except FileExistsError: + pass patch_path = self.temp_path.joinpath(diff_file) old_suffix = old_file.suffix old_file = await old_file.rename(old_file.with_suffix(".bak")) proc = await self._hdiffpatch.patch_file(old_file, old_file.with_suffix(old_suffix), patch_path, wait=True) - await patch_path.unlink() + patch_path.unlink() if proc.returncode != 0: # Let the game download the file. await old_file.rename(old_file.with_suffix(old_suffix))