Files
MemRelay/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用 Python 脚本打 Windows 分发 zip.md
T
memrelay 76e8f4f7a4 create: 用 Python 脚本打 Windows 分发 zip
MemRelay-Operation: memory-save:rapt-package-py-20260927
MemRelay-Resource: c8015de9-c56c-478b-a0b9-2e77f00d6dd2
2026-09-27 06:48:25 +08:00

30 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 用 Python 脚本打 Windows 分发 zip
type: decision
permalink: main/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用-python-脚本打-windows-分发-zip
stable_id: c8015de9-c56c-478b-a0b9-2e77f00d6dd2
scope: project
memory_type: decision
project_id: 280dd2a0-d23d-4a71-91e1-dce4353163be
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: rapt-package-py-20260927
created_at: '2026-09-26T22:48:23.721430+00:00'
updated_at: '2026-09-26T22:48:23.721430+00:00'
tags:
- packaging
- windows
---
Windows 分发包用仓库根目录的 `python scripts/package.py` 生成。脚本按平台拆开:目前只实现 Windows;macOS 和 Linux 进入对应函数会直接退出并说明运行时还没接上。
产物:`dist/RaptDrama-Download-Tools-windows-x64.zip`,顶层目录 `RaptDrama-Download-Tools`。解压后运行 `raptdrama.exe`。包内有 release 程序、`dist/ui`、`server`(不含 `.venv`)、嵌入式 Python 3.13.15(`runtime/python`)、ffmpeg(`tools/ffmpeg/ffmpeg.exe`)、WebView2 固定版本 154.0.4258.37(`vendor/webview2`)。
WebView2 不能用单个 Core nupkg。从 152 起运行时拆成三个 NuGet 包,都要合并到同一个 `WebView2` 目录:`webview2.runtime.x64`、`webview2.runtime.x64.core`(里面是 msedge.dll)、`webview2.runtime.locales`(含 zh-CN.pak)。下载地址是 `https://api.nuget.org/v3-flatcontainer/{id}/{version}/{id}.{version}.nupkg`,文件名必须带版本号,否则 404。缓存在 `dist/cache`,不提交。
Cargo 输出目录由 `src-tauri/.cargo/config.toml` 指到 `dist/target`,release 程序是 `dist/target/release/raptdrama.exe`,不是 `src-tauri/target/release`。
Windows 10 上固定版本运行时从 v120 起要给目录授予 AppContainer 读执行权限。解压不会保留 ACL,所以 `prepare_webview_runtime` 在第一次启动时对 `vendor/webview2` 执行 `icacls`(`*S-1-15-2-2` 和 `*S-1-15-2-1` 的 (OI)(CI)(RX)),成功后写 `.appcontainer-acl` 标记,避免每次重复授权。窗口宽度 1080、背景 `#363636` 是用户改过的,不要改回。
这次打包相关改动(README、scripts/package.py、lib.rs 的运行时路径和 ACL)尚未提交。用户没有要求提交或推送。