cargo-nw
Application deployment package builder for Node-Webkit
Overview
cargo-nw
allows creation custom application deployment packages for NW applications by bundling application files with NW binaries.
This tool was created to build NW Rust WASM applications, but it can be used with any new or existing project.
The deployment is controlled by nw.toml
manifest file that allows full customization of information packages in distributables, creation of additional actions (such as program executions during different stages of the build process), copying groups of files using globs or regex filters.
For application icons, only a single large-size .png
file needs to be supplied - cargo-nw
will automatically resize and generate all appropriate icon variations and file formats. Custom icons can be supplied for each OS.
OS support
- MacOS: DMG, archive
- Windows: InnoSetup, archive
- Linux: SNAP, archive
NOTE: To create a redistributable for each platform, you need to run cargo-nw
on that specific platform.
Features
- No external dependencies for basic functionality
- Automatic download of NW distribution binaries (optionally SDK)
- Automatic handling of application icons
- Automatic creation of
.desktop
file on Linux - Automatic handling of DMG resources
- Automatic handling of MacOS and Windows resource manifests
- Custom strings for Windows resource manifests
- SNAP support for different types of confinement
- Creation of firewall rules during Windows installs
- Optional inclusion of FFMPEG libraries
Dependencies
- Rust
- InnoSetup for Windows for creation of interactive Windows installers
- Wasmpack if building NW WASM applications in Rust
- SnapCraft + LXD
Installation
Documentation
For detailed documentation please see Cargo NW Documentation
Manifest
The nw.toml
package manifest file contains TOML specification for the project. It is typically located in the project root.
[]
= "my-app"
= "My App"
= "0.1.0"
= "My Organization"
[]
= "This is my app" # max 78 chars
= """
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur.
"""
[]
= ["resources/setup"]
= [
{ = { = "my-package-script $OUTPUT" } },
]
[]
= "0.70.1"
= false
[]
= "95ba1908-ff47-4281-4dca-7461bc1ee058"
= "App Group" # Windows start menu group
= "everyone"
= true
= [
{ = { = "CustomString", = "My Info" }},
]
[]
= ["english","french"]
[]
= "in:out"
= [ "bin\\windows-x64\\my-utility.exe" ]
= [ "bin\\windows-x64\\test.exe" ]