From e264d324757fc87b36ac6c7d21ee8151f50fca62 Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:18:14 -0700 Subject: [PATCH 1/7] fix #1555 for leaving files after Windows uninstall --- windows/installer.nsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/installer.nsi b/windows/installer.nsi index 762250581..8777c1df1 100644 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -111,9 +111,11 @@ SectionEnd Section "Uninstall" RMDir /r "$INSTDIR\data" + RMDir /r "$INSTDIR\hidapi-src" Delete "$INSTDIR\LICENSE.txt" Delete "$INSTDIR\plover.exe" Delete "$INSTDIR\plover_console.exe" + Delete "$INSTDIR\vcruntime140.dll" Delete "$INSTDIR\uninstall.exe" RMDir "$INSTDIR" From ac6a9a3a6db399ae01fe795c97ac43ff22919ca8 Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:20:48 -0700 Subject: [PATCH 2/7] fixes #1780 --- plover/plugins_manager/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plover/plugins_manager/__main__.py b/plover/plugins_manager/__main__.py index 96538bcb8..153fdc4b9 100644 --- a/plover/plugins_manager/__main__.py +++ b/plover/plugins_manager/__main__.py @@ -82,7 +82,7 @@ def list_plugins(freeze=False): def main(args=None): if args is None: args = sys.argv[1:] - if args[0] == "list_plugins": + if args and args[0] == "list_plugins": assert len(args) <= 2 if len(args) > 1: assert args[1] == "--freeze" From 1e3faaf8f1c5c638435c7e15b4363abab0d0f4e8 Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:43:56 -0700 Subject: [PATCH 3/7] should print help message and exit --- plover/plugins_manager/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plover/plugins_manager/__main__.py b/plover/plugins_manager/__main__.py index 153fdc4b9..cb2fc98aa 100644 --- a/plover/plugins_manager/__main__.py +++ b/plover/plugins_manager/__main__.py @@ -82,7 +82,10 @@ def list_plugins(freeze=False): def main(args=None): if args is None: args = sys.argv[1:] - if args and args[0] == "list_plugins": + if not args: + print("Available commands: list_plugins, check, install, uninstall, list.") + sys.exit(2) + if args[0] == "list_plugins": assert len(args) <= 2 if len(args) > 1: assert args[1] == "--freeze" From c18d9da36c5c4a5bd63077addc87e119555bf24b Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:59:36 -0700 Subject: [PATCH 4/7] possibly fix error when running Windows plover not from plover dir --- plover/scripts/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plover/scripts/main.py b/plover/scripts/main.py index f72a5a2a2..3a70ce6cb 100644 --- a/plover/scripts/main.py +++ b/plover/scripts/main.py @@ -181,7 +181,8 @@ def main(): args[0:1] = [sys.executable, "-m", spec.name] if PLATFORM == "win": # Workaround https://bugs.python.org/issue19066 - subprocess.Popen(args, cwd=os.getcwd()) + win_cwd = os.path.dirname(sys.executable) + subprocess.Popen(args, cwd=win_cwd) code = 0 else: os.execv(args[0], args) From edce3db9bdd01f50a55c1059e58291a90424c34d Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:18:57 -0700 Subject: [PATCH 5/7] attempt different fix for running from different dir --- plover/scripts/dist_main.py | 1 + plover/scripts/main.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plover/scripts/dist_main.py b/plover/scripts/dist_main.py index a06e59228..a910d59ca 100644 --- a/plover/scripts/dist_main.py +++ b/plover/scripts/dist_main.py @@ -14,6 +14,7 @@ def main(): os.environ["PYTHONUSERBASE"] = os.path.join(CONFIG_DIR, "plugins", PLUGINS_PLATFORM) if PLATFORM == "win": # Workaround https://bugs.python.org/issue19066 + args[0] = '"' + sys.executable + '"' subprocess.Popen(args, cwd=os.getcwd()) sys.exit(0) os.execv(args[0], args) diff --git a/plover/scripts/main.py b/plover/scripts/main.py index 3a70ce6cb..f72a5a2a2 100644 --- a/plover/scripts/main.py +++ b/plover/scripts/main.py @@ -181,8 +181,7 @@ def main(): args[0:1] = [sys.executable, "-m", spec.name] if PLATFORM == "win": # Workaround https://bugs.python.org/issue19066 - win_cwd = os.path.dirname(sys.executable) - subprocess.Popen(args, cwd=win_cwd) + subprocess.Popen(args, cwd=os.getcwd()) code = 0 else: os.execv(args[0], args) From 0ebe479be45b1856e3eb71f72da4275a3d38346a Mon Sep 17 00:00:00 2001 From: greenwyrt <117969582+greenwyrt@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:32:25 -0700 Subject: [PATCH 6/7] revert attempted fix for running from other dir --- news.d/bugfix/1842.md | 2 ++ plover/scripts/dist_main.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news.d/bugfix/1842.md diff --git a/news.d/bugfix/1842.md b/news.d/bugfix/1842.md new file mode 100644 index 000000000..72471f084 --- /dev/null +++ b/news.d/bugfix/1842.md @@ -0,0 +1,2 @@ +Update Windows installer NSI to remove all files. +If plover_plugins does not have arguments, print available arguments and exit. \ No newline at end of file diff --git a/plover/scripts/dist_main.py b/plover/scripts/dist_main.py index a910d59ca..a06e59228 100644 --- a/plover/scripts/dist_main.py +++ b/plover/scripts/dist_main.py @@ -14,7 +14,6 @@ def main(): os.environ["PYTHONUSERBASE"] = os.path.join(CONFIG_DIR, "plugins", PLUGINS_PLATFORM) if PLATFORM == "win": # Workaround https://bugs.python.org/issue19066 - args[0] = '"' + sys.executable + '"' subprocess.Popen(args, cwd=os.getcwd()) sys.exit(0) os.execv(args[0], args) From 5fea983a514778dd5e13aa345a8880388c534e37 Mon Sep 17 00:00:00 2001 From: Martin Koerner Date: Fri, 24 Apr 2026 07:20:09 +0200 Subject: [PATCH 7/7] Fix news entry and improve printout --- news.d/bugfix/{1842.md => 1842.core.md} | 3 +-- news.d/bugfix/1842.windows.md | 1 + plover/plugins_manager/__main__.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) rename news.d/bugfix/{1842.md => 1842.core.md} (50%) create mode 100644 news.d/bugfix/1842.windows.md diff --git a/news.d/bugfix/1842.md b/news.d/bugfix/1842.core.md similarity index 50% rename from news.d/bugfix/1842.md rename to news.d/bugfix/1842.core.md index 72471f084..a82be3ece 100644 --- a/news.d/bugfix/1842.md +++ b/news.d/bugfix/1842.core.md @@ -1,2 +1 @@ -Update Windows installer NSI to remove all files. -If plover_plugins does not have arguments, print available arguments and exit. \ No newline at end of file +If plover_plugins does not have arguments, print available arguments and exit. diff --git a/news.d/bugfix/1842.windows.md b/news.d/bugfix/1842.windows.md new file mode 100644 index 000000000..24362b45f --- /dev/null +++ b/news.d/bugfix/1842.windows.md @@ -0,0 +1 @@ +Update Windows installer NSI to remove all files. diff --git a/plover/plugins_manager/__main__.py b/plover/plugins_manager/__main__.py index cb2fc98aa..324286df5 100644 --- a/plover/plugins_manager/__main__.py +++ b/plover/plugins_manager/__main__.py @@ -83,7 +83,8 @@ def main(args=None): if args is None: args = sys.argv[1:] if not args: - print("Available commands: list_plugins, check, install, uninstall, list.") + print("Usage: plover_plugins [args]") + print("Commands: list_plugins [--freeze], check, install, uninstall, list") sys.exit(2) if args[0] == "list_plugins": assert len(args) <= 2