app: make the packager config build the NSIS installer
Three faults kept `cargo packager` from producing anything. "$schema" was unquoted, which made TOML reject the file so the tool found no config at all. Without `name`, cargo-packager sets its working directory to the config *file* before reading the crate name and dies with ERROR_DIRECTORY. Without `binaries`, it has no main binary; a config file gets no auto-detection from Cargo.toml, so the binary and its directory are named here. The resource list shipped a piece of OBS (obs.dll, its plugins, two of three libobs DLLs) and none of its data, so the packaged daemon would have loaded obs.dll without avcodec, libcurl or the module data. It now copies every DLL the daemon loads, the plugin and module data, and the obs-*.exe helpers, all from the daemon's release build. The installer built from this puts the app and the daemon in one directory: on the dev machine the installed pair answers --probe in a second with a fresh data directory, and OBS 32.1.0 loads from the shipped files without downloading anything.
This commit is contained in:
1 parent
74b35b0120
commit
61862ef792
1 file changed
+16
-7
+16
-7
@@ -1,28 +1,37 @@
|
|||||||
# cargo-packager configuration for the NSIS installer (`cargo packager --release`).
|
# cargo-packager configuration for the NSIS installer (`cargo packager --release`).
|
||||||
#
|
#
|
||||||
# The app exe is the cargo binary. Everything the daemon needs at run time sits beside it in the
|
# The app exe is the cargo binary. Everything the daemon needs at run time sits beside it in the
|
||||||
# install root. OBS plugin data and the ffmpeg sidecar are already built/downloaded into
|
# install root: the daemon, OBS and its data are built into record-daemon/target/release by the
|
||||||
# record-daemon/target/release, so they are copied from there.
|
# daemon's own build and copied from there. The app downloads ffmpeg itself on the first export.
|
||||||
$schema = "https://raw.githubusercontent.com/crabnebula-dev/cargo-packager/main/crates/packager/schema.json"
|
"$schema" = "https://raw.githubusercontent.com/crabnebula-dev/cargo-packager/main/crates/packager/schema.json"
|
||||||
|
|
||||||
|
name = "leaguerecorder"
|
||||||
product-name = "League Recorder"
|
product-name = "League Recorder"
|
||||||
identifier = "v.leaguerecorder"
|
identifier = "v.leaguerecorder"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
description = "Records League of Legends games through the record-daemon."
|
description = "Records League of Legends games through the record-daemon."
|
||||||
out-dir = "dist"
|
out-dir = "dist"
|
||||||
|
# A config file is not read from Cargo.toml, so the binary has to be named. The app crate
|
||||||
|
# builds one.
|
||||||
|
binaries-dir = "target/release"
|
||||||
|
binaries = [{ path = "leaguerecorder", main = true }]
|
||||||
before-packaging-command = "cargo build --release && cargo build --release --manifest-path ../record-daemon/Cargo.toml"
|
before-packaging-command = "cargo build --release && cargo build --release --manifest-path ../record-daemon/Cargo.toml"
|
||||||
formats = ["nsis"]
|
formats = ["nsis"]
|
||||||
icons = ["icons/icon.ico"]
|
icons = ["icons/icon.ico"]
|
||||||
|
|
||||||
|
# Everything the daemon loads from beside its exe: the binary, obs.dll and the DLLs it pulls in
|
||||||
|
# (ffmpeg, x264, curl, srt, …), the module data and the plugins with their data. Shipping the
|
||||||
|
# whole set keeps a first run offline; the daemon can also fetch OBS when a piece is missing.
|
||||||
resources = [
|
resources = [
|
||||||
{ src = "../record-daemon/target/release/record-daemon.exe", target = "record-daemon.exe" },
|
{ src = "../record-daemon/target/release/record-daemon.exe", target = "record-daemon.exe" },
|
||||||
{ src = "../record-daemon/target/release/obs.dll", target = "obs.dll" },
|
{ src = "../record-daemon/target/release/*.dll", target = "." },
|
||||||
|
{ src = "../record-daemon/target/release/obs-*.exe", target = "." },
|
||||||
|
{ src = "../record-daemon/target/release/data", target = "data" },
|
||||||
{ src = "../record-daemon/target/release/obs-plugins", target = "obs-plugins" },
|
{ src = "../record-daemon/target/release/obs-plugins", target = "obs-plugins" },
|
||||||
{ src = "../record-daemon/target/release/win-capture", target = "win-capture" },
|
{ src = "../record-daemon/target/release/win-capture", target = "win-capture" },
|
||||||
{ src = "../record-daemon/target/release/rtmp-services", target = "rtmp-services" },
|
{ src = "../record-daemon/target/release/rtmp-services", target = "rtmp-services" },
|
||||||
{ src = "../record-daemon/target/release/libobs-d3d11.dll", target = "libobs-d3d11.dll" },
|
{ src = "../record-daemon/target/release/iconengines", target = "iconengines" },
|
||||||
{ src = "../record-daemon/target/release/libobs-opengl.dll", target = "libobs-opengl.dll" },
|
{ src = "../record-daemon/target/release/styles", target = "styles" },
|
||||||
{ src = "../record-daemon/target/release/libobs-winrt.dll", target = "libobs-winrt.dll" },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[nsis]
|
[nsis]
|
||||||
|
|||||||
Reference in new issue
Block a user