diff --git a/backend/app/extensions/archive.py b/backend/app/extensions/archive.py index 58640ff..b74c729 100644 --- a/backend/app/extensions/archive.py +++ b/backend/app/extensions/archive.py @@ -82,6 +82,8 @@ def install_zip(data: bytes, kind: str, storage: Path, install: Callable[[Path], if written > MAX_EXPANDED_BYTES: raise ApiError(413, 'EXTENSION_ZIP_TOO_LARGE', 'ZIP 解压后不能超过 50 MiB。') output.write(chunk) + if (entry.external_attr >> 16) & 0o111: + target.chmod(0o755) manifest = f'{kind}.yaml' root = destination if not (root / manifest).is_file(): diff --git a/backend/extensions/community/build_packages.py b/backend/extensions/community/build_packages.py index d6d9f5e..c57e2f1 100644 --- a/backend/extensions/community/build_packages.py +++ b/backend/extensions/community/build_packages.py @@ -42,7 +42,7 @@ def build(output: Path | None = None) -> dict: for name in sorted(files): info = zipfile.ZipInfo(f'{identity}/{name}', date_time=(1980, 1, 1, 0, 0, 0)) info.create_system = 3 - info.external_attr = 0o100644 << 16 + info.external_attr = (0o100755 if name == 'markdown-workbench.exe' else 0o100644) << 16 info.compress_type = zipfile.ZIP_DEFLATED content = generated.get(name) if content is None: