From 969bee8aea3aaa6838bfa644c7b13d57d6340be2 Mon Sep 17 00:00:00 2001 From: MemRelay Date: Sun, 27 Sep 2026 07:07:05 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=89=93=E5=8C=85=E6=8B=B7=E8=B4=9D?= =?UTF-8?q?=20vendor=20=E9=87=8C=E7=9A=84=20adb=20=E5=92=8C=20WebView2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: memory-save:rapt-package-copy-vendor-20260927 MemRelay-Resource: c8015de9-c56c-478b-a0b9-2e77f00d6dd2 --- .../打包拷贝 vendor 里的 adb 和 WebView2.md | 25 ++++++++++++++++ .../用 Python 脚本打 Windows 分发 zip.md | 30 ------------------- 2 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 projects/280dd2a0-d23d-4a71-91e1-dce4353163be/打包拷贝 vendor 里的 adb 和 WebView2.md delete mode 100644 projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用 Python 脚本打 Windows 分发 zip.md diff --git a/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/打包拷贝 vendor 里的 adb 和 WebView2.md b/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/打包拷贝 vendor 里的 adb 和 WebView2.md new file mode 100644 index 0000000..d33e069 --- /dev/null +++ b/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/打包拷贝 vendor 里的 adb 和 WebView2.md @@ -0,0 +1,25 @@ +--- +title: 打包拷贝 vendor 里的 adb 和 WebView2 +type: decision +permalink: main/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/打包拷贝-vendor-里的-adb-和-web-view2 +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: 2 +request_id: rapt-package-copy-vendor-20260927 +created_at: '2026-09-26T22:48:23.721430+00:00' +updated_at: '2026-09-26T23:07:02.062460+00:00' +--- + +打包不再下载 adb 和 WebView2。本地已有文件直接拷贝: + +- adb 放在 `vendor/platform-tools`(adb.exe、AdbWinApi.dll、AdbWinUsbApi.dll、libwinpthread-1.dll,platform-tools 37.0.0)。打包时拷到压缩包的 `tools/platform-tools`。运行时也会找 `vendor/platform-tools`。 +- WebView2 使用已经放在 `vendor/webview2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe` 的离线安装包,不使用 NuGet 固定版本运行时。本机注册表没有 Evergreen 运行时时,启动程序执行该安装包 `/silent /install`。 +- README 不打进 zip。 +- ffmpeg 仍从 `tools/ffmpeg/ffmpeg.exe` 拷贝。 +- 嵌入式 Python 仍使用 `dist/cache`,缺少时才下载。 + +`vendor/platform-tools/` 已加入 .gitignore。旧的 `dist/RaptDrama-Download-Tools-windows-x64.zip` 被占用时,新包写到同目录的 `-new.zip`。 \ No newline at end of file diff --git a/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用 Python 脚本打 Windows 分发 zip.md b/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用 Python 脚本打 Windows 分发 zip.md deleted file mode 100644 index 4e2ebff..0000000 --- a/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/用 Python 脚本打 Windows 分发 zip.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -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)尚未提交。用户没有要求提交或推送。 \ No newline at end of file