Files
Noah e4fb9c01df feat(desktop): bundle ffmpeg and run external tools without console windows (#1735)
* feat(cli): locate ffmpeg via ffmpeg_path / host / PATH and start child processes without console windows

- New `tools` module in both crates. `tools::command()` starts external
  programs with CREATE_NO_WINDOW on Windows; every ffmpeg, streamlink,
  yt-dlp, ytarchive and hook shell process now goes through it.
- ffmpeg is looked up in this order: the new optional `ffmpeg_path`
  setting, then `ServeOptions::ffmpeg` (for an ffmpeg shipped by the
  embedding host), then `ffmpeg` on PATH. Unset keeps today's behaviour.
- `ffmpeg_path` is global (not overridable per streamer) and visible in
  the redacted configuration.

* feat(api): GET /v1/tools reports ffmpeg availability, version and license

Read-only, allowed for every logged-in role. Returns whether the ffmpeg
that would be used runs, where it came from (config / bundled / path),
the first line of `ffmpeg -version` (cached per program; failures are
retried) and the license derived from its configure flags. Errors say
what to fix.

* feat(desktop): bundle ffmpeg in the Windows installer, same BtbN build as Docker

- desktop-publish.yml downloads the BtbN win64 GPL static zip of the tag
  and version the Dockerfile pins (read by .github/scripts/ffmpeg-version.sh),
  checks its SHA-256 and ships only ffmpeg.exe, LICENSE.txt and a README
  with the source links as bundle resources (tauri.ffmpeg.conf.json),
  installed under ffmpeg\.
- The shell passes resource_dir()/ffmpeg/ffmpeg.exe to ServeOptions::ffmpeg
  when the file exists. The ffmpeg_path setting still wins; builds without
  the overlay keep using PATH.

* ci(desktop): attach the FFmpeg corresponding source and download notes to releases

- New ffmpeg-source job: FFmpeg at the pinned commit, the BtbN build
  scripts at the pinned tag, and the source of every library those
  scripts build (fetched by their own download.sh at the commits pinned
  in scripts.d/), plus a README and SHA256SUMS. Uploaded on release
  events only; manual runs just list the files.
- On release events, append .github/desktop-release-notes.md to the
  release body once: setup.exe is the recommended download, and how to
  get past the browser warning and SmartScreen while it is unsigned.

* fix(cli): only use CREATE_NO_WINDOW when biliup has no console

`biliup server` in a Windows terminal keeps sharing its console with the
programs it starts, as before: Ctrl+C and their output still reach the
terminal. Only a process without a console window (the desktop app)
starts them with CREATE_NO_WINDOW. The choice is logged at startup and
covered by a Windows-only test that runs itself as a child with and
without a console.

* ci(desktop): link to the upstream FFmpeg source instead of uploading it to releases

Drop the ffmpeg-source job that packed about 2 GB of FFmpeg and dependency
source into every release. The installer's ffmpeg/README.txt and the release
notes now point to the FFmpeg commit and the BtbN/FFmpeg-Builds tree of the
bundled build (full commit hashes, resolved at build time), whose scripts.d/
pins the version and source URL of every library. The Docker image uses the
same BtbN tag, so the same links cover it.
2026-09-24 09:50:42 +00:00

1.8 KiB
Raw Permalink Blame History

biliup 桌面版

Tauri 壳:在本进程内启动 biliup 服务(biliup_cli::entry::serve),监听 127.0.0.1:19159(被占用时换一个空闲端口),就绪后在窗口里打开 WebUI。没有 sidecar 子进程。

  • 数据目录(data/、ds_update.log、cookies.json 和录像都在这里):
    • Windows,程序不在系统盘(%SystemDrive%)上:就是安装目录,与旧版相同。
    • Windows,程序在系统盘上:首次启动弹窗让用户选——默认目录(Tauri 的 app_data_dir(),即 %APPDATA%\com.biliup.desktop)、安装目录或其他目录。选择保存在 app_config_dir() 下的 desktop.json({"data_dir": "..."}),之后不再询问;删掉这个文件即可重新选择。
    • 其他平台:app_data_dir(),不询问(desktop.json 里写了 data_dir 则用它)。
    • 所选目录还没有 data/ 时,会把旧版留下的 data/ 复制过去,原处保留。旧版的位置依次找:安装目录、Windows 上旧 bbup-app 安装程序记录的安装目录(注册表)和 %LOCALAPPDATA%\bbup-app。
  • static/index.html 只是启动页,显示「正在启动」或启动失败的原因。
  • ffmpeg:发布 workflow 下载与 Dockerfile 同一构建的 BtbN win64 GPL 静态版,把 ffmpeg.exe、LICENSE.txt 和说明放进 src-tauri/ffmpeg/,构建时用 --config src-tauri/tauri.ffmpeg.conf.json 作为资源打进安装包。程序启动时若安装目录下有 ffmpeg/ffmpeg.exe 就交给服务使用(配置里填了 ffmpeg_path 时以配置为准),否则到 PATH 里找。本地构建不加这个参数即可,不需要下载 ffmpeg。

构建(需要先在仓库根目录 npm run build 生成 out/,WebUI 会被编进程序):

npm install && npm run build   # 仓库根目录
cd tauri-app && npm ci && npm run tauri build