summaryrefslogtreecommitdiffhomepage
path: root/mullvad-problem-report
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-09-25 22:05:31 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-09-25 22:05:31 +0200
commitfc7802aca100b542a0e53bcd81eb3b64ba27c6fd (patch)
tree54cb07daf2396b5aa7f9033c76ba65d0ff8c8c40 /mullvad-problem-report
parente0619be7d66bd3db2136d640e15131685d6084b9 (diff)
parent3ce466bb2388e951a66ca9edea1d3e84a704a2ee (diff)
downloadmullvadvpn-fc7802aca100b542a0e53bcd81eb3b64ba27c6fd.tar.xz
mullvadvpn-fc7802aca100b542a0e53bcd81eb3b64ba27c6fd.zip
Merge branch 'replace-windres-with-winres'
Diffstat (limited to 'mullvad-problem-report')
-rw-r--r--mullvad-problem-report/Cargo.toml10
-rw-r--r--mullvad-problem-report/build.rs16
-rw-r--r--mullvad-problem-report/version.rc27
3 files changed, 22 insertions, 31 deletions
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