From 4b99162bce88d98d70a7ca8bbb6fda9b64b008e0 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Thu, 31 Mar 2022 20:38:59 +0700 Subject: [PATCH] Fix hdiffpatch executables not being detected on Windows Signed-off-by: tretrauit --- setup.py | 2 +- worthless/installer.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e879fb1..f0297b3 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text() setup( name='worthless', - version='1.3.0', + version='1.3.1', 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 9bff2b2..6e141ca 100644 --- a/worthless/installer.py +++ b/worthless/installer.py @@ -95,7 +95,8 @@ class HDiffPatch: return None def get_hpatchz_executable(self): - return self._get_hdiffpatch_exec("hpatchz") + hpatchz_name = "hpatchz" + (".exe" if platform.system() == "Windows" else "") + return self._get_hdiffpatch_exec(hpatchz_name) async def patch_file(self, in_file, out_file, patch_file): hpatchz = self.get_hpatchz_executable() @@ -104,7 +105,8 @@ class HDiffPatch: return await asyncio.create_subprocess_exec(hpatchz, "-f", in_file, patch_file, out_file) def get_hdiffz_executable(self): - return self._get_hdiffpatch_exec("hdiffz") + hdiffz_name = "hdiffz" + (".exe" if platform.system() == "Windows" else "") + return self._get_hdiffpatch_exec(hdiffz_name) async def _get_latest_release_info(self): async with aiohttp.ClientSession() as session: