diff options
| author | Odd Stranne <odd@mullvad.net> | 2018-07-11 16:13:46 +0200 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2018-07-12 14:52:02 +0200 |
| commit | b5b8cf466a0858168b117281a8836f2a60dfd25f (patch) | |
| tree | 8362e03f61e78e34ed9d65b0ea6aea7c06b7aa98 | |
| parent | ad7f1a05a28b883c2e73fbf7b3d6053af98b5c04 (diff) | |
| download | mullvadvpn-b5b8cf466a0858168b117281a8836f2a60dfd25f.tar.xz mullvadvpn-b5b8cf466a0858168b117281a8836f2a60dfd25f.zip | |
Add version information for Rust binaries
| -rwxr-xr-x | build.sh | 16 | ||||
| -rw-r--r-- | dist-assets/windows/version.h | 4 | ||||
| -rw-r--r-- | mullvad-cli/Cargo.toml | 3 | ||||
| -rw-r--r-- | mullvad-cli/build.rs | 9 | ||||
| -rw-r--r-- | mullvad-cli/version.rc | 27 | ||||
| -rw-r--r-- | mullvad-daemon/Cargo.toml | 3 | ||||
| -rw-r--r-- | mullvad-daemon/build.rs | 7 | ||||
| -rw-r--r-- | mullvad-daemon/version.rc | 27 | ||||
| -rw-r--r-- | mullvad-problem-report/Cargo.toml | 3 | ||||
| -rw-r--r-- | mullvad-problem-report/build.rs | 7 | ||||
| -rw-r--r-- | mullvad-problem-report/version.rc | 27 | ||||
| -rw-r--r-- | talpid-openvpn-plugin/Cargo.toml | 3 | ||||
| -rw-r--r-- | talpid-openvpn-plugin/build.rs | 9 | ||||
| -rw-r--r-- | talpid-openvpn-plugin/version.rc | 25 |
14 files changed, 170 insertions, 0 deletions
@@ -72,6 +72,7 @@ function restore_metadata_backups() { mv mullvad-daemon/Cargo.toml.bak mullvad-daemon/Cargo.toml || true mv mullvad-cli/Cargo.toml.bak mullvad-cli/Cargo.toml || true mv mullvad-problem-report/Cargo.toml.bak mullvad-problem-report/Cargo.toml || true + mv dist-assets/windows/version.h.bak dist-assets/windows/version.h || true } trap 'restore_metadata_backups' EXIT @@ -85,6 +86,21 @@ sed -i.bak \ mullvad-daemon/Cargo.toml \ mullvad-cli/Cargo.toml \ mullvad-problem-report/Cargo.toml + +SEMVER_ARRAY=($(echo $SEMVER_VERSION | sed -r 's/[.-]+/ /g')) + +SEMVER_MAJOR=${SEMVER_ARRAY[0]} +SEMVER_MINOR=${SEMVER_ARRAY[1]} +SEMVER_PATCH=${SEMVER_ARRAY[2]} + +cp dist-assets/windows/version.h dist-assets/windows/version.h.bak + +cat <<EOF > dist-assets/windows/version.h +#define MAJOR_VERSION $SEMVER_MAJOR +#define MINOR_VERSION $SEMVER_MINOR +#define PATCH_VERSION $SEMVER_PATCH +#define PRODUCT_VERSION "$PRODUCT_VERSION" +EOF ################################################################################ # Compile and link all binaries. diff --git a/dist-assets/windows/version.h b/dist-assets/windows/version.h new file mode 100644 index 0000000000..aee870e38a --- /dev/null +++ b/dist-assets/windows/version.h @@ -0,0 +1,4 @@ +#define MAJOR_VERSION 1 +#define MINOR_VERSION 2 +#define PATCH_VERSION 3 +#define PRODUCT_VERSION "1.2.3-internal" diff --git a/mullvad-cli/Cargo.toml b/mullvad-cli/Cargo.toml index dbbe098aa5..f0ab1dd23c 100644 --- a/mullvad-cli/Cargo.toml +++ b/mullvad-cli/Cargo.toml @@ -19,3 +19,6 @@ mullvad-ipc-client = { path = "../mullvad-ipc-client" } mullvad-types = { path = "../mullvad-types" } talpid-types = { path = "../talpid-types" } talpid-ipc = { path = "../talpid-ipc" } + +[target.'cfg(windows)'.build-dependencies] +windres = "0.1" diff --git a/mullvad-cli/build.rs b/mullvad-cli/build.rs new file mode 100644 index 0000000000..b64f22f208 --- /dev/null +++ b/mullvad-cli/build.rs @@ -0,0 +1,9 @@ +#[cfg(windows)] +extern crate windres; + +fn main() { + #[cfg(windows)] + { + windres::Build::new().compile("version.rc").unwrap(); + } +} diff --git a/mullvad-cli/version.rc b/mullvad-cli/version.rc new file mode 100644 index 0000000000..8f9db10b4d --- /dev/null +++ b/mullvad-cli/version.rc @@ -0,0 +1,27 @@ +#include "../dist-assets/windows/version.h" + +IDI_MAIN ICON "../dist-assets/icon.ico" + +1 VERSIONINFO +FILEVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +BEGIN +BLOCK "StringFileInfo" +BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Amagicom AB" + VALUE "FileDescription", "CLI for Mullvad VPN" + VALUE "FileVersion", PRODUCT_VERSION + VALUE "InternalName", "mullvad-cli" + VALUE "LegalCopyright", "(c) 2018 Amagicom AB" + VALUE "OriginalFilename", "mullvad.exe" + VALUE "ProductName", "Mullvad VPN" + VALUE "ProductVersion", PRODUCT_VERSION + END +END +BLOCK "VarFileInfo" +BEGIN + VALUE "Translation", 0x409, 1252 +END +END diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml index c40209c897..c24304c35e 100644 --- a/mullvad-daemon/Cargo.toml +++ b/mullvad-daemon/Cargo.toml @@ -41,3 +41,6 @@ simple-signal = "1.1" ctrlc = "3.0" windows-service = { git = "https://github.com/mullvad/windows-service-rs.git", rev = "55c5dfb372e6b3f5607a3159c5388d27b6b84ff6" } winapi = "0.3" + +[target.'cfg(windows)'.build-dependencies] +windres = "0.1" diff --git a/mullvad-daemon/build.rs b/mullvad-daemon/build.rs index f1f507670e..246b38d13d 100644 --- a/mullvad-daemon/build.rs +++ b/mullvad-daemon/build.rs @@ -3,6 +3,8 @@ use std::fs; use std::path::PathBuf; use std::process::Command; +#[cfg(windows)] +extern crate windres; fn main() { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); @@ -10,6 +12,11 @@ fn main() { let product_version = env!("CARGO_PKG_VERSION").replacen(".0", "", 1); fs::write(out_dir.join("product-version.txt"), product_version).unwrap(); fs::write(out_dir.join("git-commit-date.txt"), commit_date()).unwrap(); + + #[cfg(windows)] + { + windres::Build::new().compile("version.rc").unwrap(); + } } fn commit_date() -> String { diff --git a/mullvad-daemon/version.rc b/mullvad-daemon/version.rc new file mode 100644 index 0000000000..70733c046b --- /dev/null +++ b/mullvad-daemon/version.rc @@ -0,0 +1,27 @@ +#include "../dist-assets/windows/version.h" + +IDI_MAIN ICON "../dist-assets/icon.ico" + +1 VERSIONINFO +FILEVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +BEGIN +BLOCK "StringFileInfo" +BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Amagicom AB" + VALUE "FileDescription", "Daemon that manages the VPN tunnel and system security" + VALUE "FileVersion", PRODUCT_VERSION + VALUE "InternalName", "mullvad-daemon" + VALUE "LegalCopyright", "(c) 2018 Amagicom AB" + VALUE "OriginalFilename", "mullvad-daemon.exe" + VALUE "ProductName", "Mullvad VPN" + VALUE "ProductVersion", PRODUCT_VERSION + END +END +BLOCK "VarFileInfo" +BEGIN + VALUE "Translation", 0x409, 1252 +END +END diff --git a/mullvad-problem-report/Cargo.toml b/mullvad-problem-report/Cargo.toml index 66358a4a36..b0300bb516 100644 --- a/mullvad-problem-report/Cargo.toml +++ b/mullvad-problem-report/Cargo.toml @@ -18,3 +18,6 @@ uuid = { version = "0.6", features = ["v4"] } mullvad-paths = { path = "../mullvad-paths" } mullvad-rpc = { path = "../mullvad-rpc" } + +[target.'cfg(windows)'.build-dependencies] +windres = "0.1" diff --git a/mullvad-problem-report/build.rs b/mullvad-problem-report/build.rs index f1f507670e..b07e8bbb1c 100644 --- a/mullvad-problem-report/build.rs +++ b/mullvad-problem-report/build.rs @@ -3,6 +3,8 @@ use std::fs; use std::path::PathBuf; use std::process::Command; +#[cfg(windows)] +extern crate windres; fn main() { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); @@ -10,6 +12,11 @@ fn main() { let product_version = env!("CARGO_PKG_VERSION").replacen(".0", "", 1); fs::write(out_dir.join("product-version.txt"), product_version).unwrap(); fs::write(out_dir.join("git-commit-date.txt"), commit_date()).unwrap(); + + #[cfg(windows)] + { + windres::Build::new().compile("version.rc").unwrap(); + } } fn commit_date() -> String { diff --git a/mullvad-problem-report/version.rc b/mullvad-problem-report/version.rc new file mode 100644 index 0000000000..6c8930cec3 --- /dev/null +++ b/mullvad-problem-report/version.rc @@ -0,0 +1,27 @@ +#include "../dist-assets/windows/version.h" + +IDI_MAIN ICON "../dist-assets/icon.ico" + +1 VERSIONINFO +FILEVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +BEGIN +BLOCK "StringFileInfo" +BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Amagicom AB" + VALUE "FileDescription", "Generate and submit a problem report for Mullvad VPN" + VALUE "FileVersion", PRODUCT_VERSION + VALUE "InternalName", "mullvad-problem-report" + VALUE "LegalCopyright", "(c) 2018 Amagicom AB" + VALUE "OriginalFilename", "problem-report.exe" + VALUE "ProductName", "Mullvad VPN" + VALUE "ProductVersion", PRODUCT_VERSION + END +END +BLOCK "VarFileInfo" +BEGIN + VALUE "Translation", 0x409, 1252 +END +END diff --git a/talpid-openvpn-plugin/Cargo.toml b/talpid-openvpn-plugin/Cargo.toml index 2663141a3c..45751ff796 100644 --- a/talpid-openvpn-plugin/Cargo.toml +++ b/talpid-openvpn-plugin/Cargo.toml @@ -15,3 +15,6 @@ env_logger = "0.5" openvpn-plugin = { version = "0.3", features = ["serde", "log"] } talpid-ipc = { path = "../talpid-ipc" } + +[target.'cfg(windows)'.build-dependencies] +windres = "0.1" diff --git a/talpid-openvpn-plugin/build.rs b/talpid-openvpn-plugin/build.rs new file mode 100644 index 0000000000..b64f22f208 --- /dev/null +++ b/talpid-openvpn-plugin/build.rs @@ -0,0 +1,9 @@ +#[cfg(windows)] +extern crate windres; + +fn main() { + #[cfg(windows)] + { + windres::Build::new().compile("version.rc").unwrap(); + } +} diff --git a/talpid-openvpn-plugin/version.rc b/talpid-openvpn-plugin/version.rc new file mode 100644 index 0000000000..299c720f39 --- /dev/null +++ b/talpid-openvpn-plugin/version.rc @@ -0,0 +1,25 @@ +#include "../dist-assets/windows/version.h" + +1 VERSIONINFO +FILEVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,PATCH_VERSION,0 +BEGIN +BLOCK "StringFileInfo" +BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Amagicom AB" + VALUE "FileDescription", "Mullvad VPN OpenVPN plugin" + VALUE "FileVersion", PRODUCT_VERSION + VALUE "InternalName", "talpid-openvpn-plugin" + VALUE "LegalCopyright", "(c) 2018 Amagicom AB" + VALUE "OriginalFilename", "talpid_openvpn_plugin.dll" + VALUE "ProductName", "Mullvad VPN" + VALUE "ProductVersion", PRODUCT_VERSION + END +END +BLOCK "VarFileInfo" +BEGIN + VALUE "Translation", 0x409, 1252 +END +END |
