summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-09-21 13:13:56 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-09-24 16:36:49 +0200
commit3ce466bb2388e951a66ca9edea1d3e84a704a2ee (patch)
tree54cb07daf2396b5aa7f9033c76ba65d0ff8c8c40
parente0619be7d66bd3db2136d640e15131685d6084b9 (diff)
downloadmullvadvpn-3ce466bb2388e951a66ca9edea1d3e84a704a2ee.tar.xz
mullvadvpn-3ce466bb2388e951a66ca9edea1d3e84a704a2ee.zip
Use winres in all binary crates to set Windows resource metadata
-rw-r--r--Cargo.lock37
-rwxr-xr-xbuild.sh4
-rw-r--r--mullvad-cli/Cargo.toml10
-rw-r--r--mullvad-cli/build.rs14
-rw-r--r--mullvad-cli/version.rc27
-rw-r--r--mullvad-problem-report/Cargo.toml10
-rw-r--r--mullvad-problem-report/build.rs16
-rw-r--r--mullvad-problem-report/version.rc27
-rw-r--r--talpid-openvpn-plugin/Cargo.toml10
-rw-r--r--talpid-openvpn-plugin/build.rs14
-rw-r--r--talpid-openvpn-plugin/version.rc25
11 files changed, 73 insertions, 121 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5418b80e24..00bc442bc0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -158,11 +158,6 @@ dependencies = [
]
[[package]]
-name = "concat-string"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "core-foundation"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -349,16 +344,6 @@ dependencies = [
]
[[package]]
-name = "find-winsdk"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
- "winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "fnv"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -908,7 +893,8 @@ dependencies = [
"serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
"talpid-ipc 0.1.0",
"talpid-types 0.1.0",
- "windres 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -990,7 +976,8 @@ dependencies = [
"regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rs-release 0.1.7 (git+https://github.com/mullvad/rs-release?branch=snailquote-unescape)",
"uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "windres 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1702,7 +1689,8 @@ dependencies = [
"talpid-ipc 0.1.0",
"tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "windres 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2147,20 +2135,10 @@ dependencies = [
]
[[package]]
-name = "windres"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "concat-string 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "find-winsdk 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "winreg"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2203,7 +2181,6 @@ dependencies = [
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533"
-"checksum concat-string 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7439becb5fafc780b6f4de382b1a7a3e70234afe783854a4702ee8adbb838609"
"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980"
"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa"
"checksum crossbeam-deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8153ef04a7594ded05b427ffad46ddeaf22e63fd48d42b3e1e3bb4db07cae7"
@@ -2224,7 +2201,6 @@ dependencies = [
"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426"
"checksum fern 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "57915fe00a83af935983eb2d00b0ecc62419c4741b28c207ecbf98fd4a1b94c8"
"checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f"
-"checksum find-winsdk 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8cbf17b871570c1f8612b763bac3e86290602bcf5dc3c5ce657e0e1e9071d9e"
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
@@ -2399,7 +2375,6 @@ dependencies = [
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum wincolor 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9dc3aa9dcda98b5a16150c54619c1ead22e3d3a5d458778ae914be760aa981a"
"checksum windows-service 0.1.0 (git+https://github.com/mullvad/windows-service-rs.git?rev=55c5dfb372e6b3f5607a3159c5388d27b6b84ff6)" = "<none>"
-"checksum windres 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dd6e13ff705d7fab032bdf857354035c56c8c889e364029e4300779eb6e1d729"
"checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a"
"checksum winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f07dabda4e79413ecac65bc9a2234ad3d85dc49f9d289f868cd9d8611d88f28d"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
diff --git a/build.sh b/build.sh
index fe1d4687df..c05b1a263c 100755
--- a/build.sh
+++ b/build.sh
@@ -78,6 +78,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 talpid-openvpn-plugin/Cargo.toml.bak talpid-openvpn-plugin/Cargo.toml || true
mv dist-assets/windows/version.h.bak dist-assets/windows/version.h || true
popd
}
@@ -92,7 +93,8 @@ sed -i.bak \
-Ee "s/^version = \"[^\"]+\"\$/version = \"$SEMVER_VERSION\"/g" \
mullvad-daemon/Cargo.toml \
mullvad-cli/Cargo.toml \
- mullvad-problem-report/Cargo.toml
+ mullvad-problem-report/Cargo.toml \
+ talpid-openvpn-plugin/Cargo.toml
SEMVER_ARRAY=($(echo $SEMVER_VERSION | sed -Ee 's/[.-]+/ /g'))
SEMVER_MAJOR=${SEMVER_ARRAY[0]}
diff --git a/mullvad-cli/Cargo.toml b/mullvad-cli/Cargo.toml
index 1aadd558f5..69ad5a33a3 100644
--- a/mullvad-cli/Cargo.toml
+++ b/mullvad-cli/Cargo.toml
@@ -23,4 +23,12 @@ talpid-types = { path = "../talpid-types" }
talpid-ipc = { path = "../talpid-ipc" }
[target.'cfg(windows)'.build-dependencies]
-windres = "0.2"
+winres = "0.1"
+winapi = "0.3"
+
+[package.metadata.winres]
+ProductName = "Mullvad VPN"
+CompanyName = "Amagicom AB"
+LegalCopyright = "(c) 2018 Amagicom AB"
+InternalName = "mullvad-cli"
+OriginalFilename = "mullvad.exe"
diff --git a/mullvad-cli/build.rs b/mullvad-cli/build.rs
index b64f22f208..126fbafc03 100644
--- a/mullvad-cli/build.rs
+++ b/mullvad-cli/build.rs
@@ -1,9 +1,19 @@
#[cfg(windows)]
-extern crate windres;
+extern crate winapi;
+#[cfg(windows)]
+extern crate winres;
fn main() {
#[cfg(windows)]
{
- windres::Build::new().compile("version.rc").unwrap();
+ let product_version = env!("CARGO_PKG_VERSION").replacen(".0", "", 1);
+ let mut res = winres::WindowsResource::new();
+ res.set("ProductVersion", &product_version);
+ res.set_icon("../dist-assets/icon.ico");
+ res.set_language(winapi::um::winnt::MAKELANGID(
+ winapi::um::winnt::LANG_ENGLISH,
+ winapi::um::winnt::SUBLANG_ENGLISH_US,
+ ));
+ res.compile().expect("Unable to generate windows resources");
}
}
diff --git a/mullvad-cli/version.rc b/mullvad-cli/version.rc
deleted file mode 100644
index 8f9db10b4d..0000000000
--- a/mullvad-cli/version.rc
+++ /dev/null
@@ -1,27 +0,0 @@
-#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-problem-report/Cargo.toml b/mullvad-problem-report/Cargo.toml
index f12117345d..ca4c344dee 100644
--- a/mullvad-problem-report/Cargo.toml
+++ b/mullvad-problem-report/Cargo.toml
@@ -24,4 +24,12 @@ mullvad-rpc = { path = "../mullvad-rpc" }
rs-release = { git = "https://github.com/mullvad/rs-release", branch = "snailquote-unescape" }
[target.'cfg(windows)'.build-dependencies]
-windres = "0.2"
+winres = "0.1"
+winapi = "0.3"
+
+[package.metadata.winres]
+ProductName = "Mullvad VPN"
+CompanyName = "Amagicom AB"
+LegalCopyright = "(c) 2018 Amagicom AB"
+InternalName = "mullvad-problem-report"
+OriginalFilename = "problem-report.exe"
diff --git a/mullvad-problem-report/build.rs b/mullvad-problem-report/build.rs
index 246b38d13d..7dfd55b2c3 100644
--- a/mullvad-problem-report/build.rs
+++ b/mullvad-problem-report/build.rs
@@ -4,21 +4,31 @@ use std::path::PathBuf;
use std::process::Command;
#[cfg(windows)]
-extern crate windres;
+extern crate winapi;
+#[cfg(windows)]
+extern crate winres;
fn main() {
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
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("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();
+ let mut res = winres::WindowsResource::new();
+ res.set("ProductVersion", &product_version);
+ res.set_icon("../dist-assets/icon.ico");
+ res.set_language(winapi::um::winnt::MAKELANGID(
+ winapi::um::winnt::LANG_ENGLISH,
+ winapi::um::winnt::SUBLANG_ENGLISH_US,
+ ));
+ res.compile().expect("Unable to generate windows resources");
}
}
+
fn commit_date() -> String {
let output = Command::new("git")
.args(&["log", "-1", "--date=short", "--pretty=format:%cd"])
diff --git a/mullvad-problem-report/version.rc b/mullvad-problem-report/version.rc
deleted file mode 100644
index 6c8930cec3..0000000000
--- a/mullvad-problem-report/version.rc
+++ /dev/null
@@ -1,27 +0,0 @@
-#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 488cef4248..0c3ac14d99 100644
--- a/talpid-openvpn-plugin/Cargo.toml
+++ b/talpid-openvpn-plugin/Cargo.toml
@@ -23,4 +23,12 @@ talpid-ipc = { path = "../talpid-ipc" }
[target.'cfg(windows)'.build-dependencies]
-windres = "0.2"
+winres = "0.1"
+winapi = "0.3"
+
+[package.metadata.winres]
+ProductName = "Mullvad VPN"
+CompanyName = "Amagicom AB"
+LegalCopyright = "(c) 2018 Amagicom AB"
+InternalName = "talpid-openvpn-plugin"
+OriginalFilename = "talpid_openvpn_plugin.dll"
diff --git a/talpid-openvpn-plugin/build.rs b/talpid-openvpn-plugin/build.rs
index b64f22f208..126fbafc03 100644
--- a/talpid-openvpn-plugin/build.rs
+++ b/talpid-openvpn-plugin/build.rs
@@ -1,9 +1,19 @@
#[cfg(windows)]
-extern crate windres;
+extern crate winapi;
+#[cfg(windows)]
+extern crate winres;
fn main() {
#[cfg(windows)]
{
- windres::Build::new().compile("version.rc").unwrap();
+ let product_version = env!("CARGO_PKG_VERSION").replacen(".0", "", 1);
+ let mut res = winres::WindowsResource::new();
+ res.set("ProductVersion", &product_version);
+ res.set_icon("../dist-assets/icon.ico");
+ res.set_language(winapi::um::winnt::MAKELANGID(
+ winapi::um::winnt::LANG_ENGLISH,
+ winapi::um::winnt::SUBLANG_ENGLISH_US,
+ ));
+ res.compile().expect("Unable to generate windows resources");
}
}
diff --git a/talpid-openvpn-plugin/version.rc b/talpid-openvpn-plugin/version.rc
deleted file mode 100644
index 299c720f39..0000000000
--- a/talpid-openvpn-plugin/version.rc
+++ /dev/null
@@ -1,25 +0,0 @@
-#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