diff --git a/Cargo.lock b/Cargo.lock index 2639979..27537ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,6 +200,7 @@ dependencies = [ "serde", "serde_cbor", "serde_json", + "static_vcruntime", "ulid", "url", "winapi", @@ -722,6 +723,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "static_vcruntime" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88c15d6fe7210ea80c578b53855615fdea0188e1630b6d9c377e1b2f2c098fa" + [[package]] name = "syn" version = "1.0.59" diff --git a/Cargo.toml b/Cargo.toml index cd4b05b..86f3e49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ url = "2.2.0" chrono = "0.4" rand = "0.8" nng = "1.0.1" +static_vcruntime = "1.5" [target.'cfg(target_family = "unix")'.dependencies] nix = "0.19" diff --git a/src/main.rs b/src/main.rs index c71e1cf..52ac7d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,10 @@ extern crate chrono; extern crate rand; extern crate serde_cbor; +// By default, Rust requires programs to deploy vcruntime140.dll when redistributing binaries on Windows. +// The static_vcruntime crate statically links the library instead. +extern crate static_vcruntime; // Required for static_vcruntime to work + use std::{io, env}; use std::fs; use directories::ProjectDirs;