Expand description

§cargo-packager-resource-resolver

Resource resolver for apps that were packaged by cargo-packager.

It resolves the root path which contains resources, which was set using the resources field of cargo packager configuration.

§Get the resource path

use cargo_packager_resource_resolver::{resources_dir, PackageFormat};

let resource_path = resources_dir(PackageFormat::Nsis).unwrap();

§Automatically detect formats

This feature is only available for apps that were built with cargo packager. So the node js binding will not work.

  1. Make sure to use the before_each_package_command field of cargo packager configuration to build your app (this will not work with the before_packaging_command field).
  2. Active the feature auto-detect-format.
use cargo_packager_resource_resolver::{resources_dir, current_format};

let resource_path = resources_dir(current_format()).unwrap();

Enums§

Functions§

  • Get the current package format. Can only be used if the app was build with cargo-packager and when the before-each-package-command Cargo feature is enabled.
  • Retrieve the resource path of your app, packaged with cargo packager.