summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk/wrapper_service.py
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:47:16 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:47:16 -0400
commitc7ca9c7ec2660d279f5e6957ef882390a8783667 (patch)
tree4abdc4faf4ab0c7c2e36681fc6c1ba7271305cc2 /py_modules/lsfg_vk/wrapper_service.py
parent4b7852b153106a487ad8fac654ea59f00aa8a8e4 (diff)
downloaddecky-lsfg-vk-c7ca9c7ec2660d279f5e6957ef882390a8783667.tar.gz
decky-lsfg-vk-c7ca9c7ec2660d279f5e6957ef882390a8783667.zip
handle decky uninstall to avoid unlaunchable game wrappers
Diffstat (limited to 'py_modules/lsfg_vk/wrapper_service.py')
-rw-r--r--py_modules/lsfg_vk/wrapper_service.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/py_modules/lsfg_vk/wrapper_service.py b/py_modules/lsfg_vk/wrapper_service.py
index 906e55b..30c2323 100644
--- a/py_modules/lsfg_vk/wrapper_service.py
+++ b/py_modules/lsfg_vk/wrapper_service.py
@@ -427,3 +427,38 @@ class WrapperService(BaseService):
"error": str(error),
"removed_files": removed or None,
}
+
+ def neutralize(self) -> Dict[str, Any]:
+ """Leave an owned passthrough wrapper for Decky-level uninstall.
+
+ Decky can remove this plugin without giving the frontend a chance to
+ clean Steam launch options first. Keeping a dependency-free wrapper
+ prevents those options from turning into a broken executable path.
+ """
+ try:
+ with self._lock:
+ _document, sidecar_exists, _ = self._read_document()
+ self._assert_wrapper_owned_or_absent()
+ self._write_file(
+ self.wrapper_path,
+ "#!/bin/sh\n"
+ f"{self.MARKER}\n"
+ "# Safe passthrough retained for existing Steam launch options.\n"
+ "exec \"$@\"\n",
+ 0o755,
+ )
+ if sidecar_exists:
+ self.sidecar_path.unlink()
+ return {
+ "success": True,
+ "message": "Replaced lsfg-vk wrapper with a safe passthrough",
+ "error": None,
+ "removed_files": [str(self.sidecar_path)] if sidecar_exists else [],
+ }
+ except Exception as error:
+ return {
+ "success": False,
+ "message": "",
+ "error": str(error),
+ "removed_files": None,
+ }