pub fn install_archive(
archive: &[u8],
expected_id: &str,
expected_version: &str,
expected_sha256: &str,
expected_permissions: &[WidgetPermission],
widgets_root: &Path,
) -> Result<InstalledWidget, String>Expand description
Installs a widget package, replacing any installed version only after every check passes.
Checks the size and SHA-256, extracts into a staging folder with path, count, size, and symlink limits, requires the manifest’s ID, version, and permissions to match the catalogue, and requires every declared file to exist. The previous version is restored if the swap fails.