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.
- Make sure to use the
before_each_package_commandfield of cargo packager configuration to build your app (this will not work with thebefore_packaging_commandfield). - Active the feature
auto-detect-format.
use cargo_packager_resource_resolver::{resources_dir, current_format};
let resource_path = resources_dir(current_format()).unwrap();Enums§
- Error
- The error type of
resource-resolver. - Package
Format - Types of supported packages by
cargo-packager.
Functions§
- current_
format - Get the current package format.
Can only be used if the app was build with cargo-packager
and when the
before-each-package-commandCargo feature is enabled. - resources_
dir - Retrieve the resource path of your app, packaged with cargo packager.