diff --git a/Cargo.lock b/Cargo.lock
index 1270490786f..770ef0dc949 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2687,6 +2687,7 @@ dependencies = [
"webrender_api 0.57.0 (git+https://github.com/servo/webrender)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winres 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3611,6 +3612,14 @@ dependencies = [
"x11-dl 2.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "winres"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "ws"
version = "0.6.0"
@@ -3996,6 +4005,7 @@ dependencies = [
"checksum winapi-i686-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ec6667f60c23eca65c561e63a13d81b44234c2e38a6b6c959025ee907ec614cc"
"checksum winapi-x86_64-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98f12c52b2630cd05d2c3ffd8e008f7f48252c042b4871c72aed9dc733b96668"
"checksum winit 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "396f0350e661940359e3c8c7d58ff847f67997943e2c80ecac374c5aa8287f63"
+"checksum winres 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "27d9192d6356d7efe8405dec6c5506b67543cf64b6049968f39f4c4623b4f25d"
"checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum x11 2.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5c4ac579b5d324dc4add02312b5d0e3e0218521e2d5779d526ac39ee4bb171"
diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml
index 730e87e3d37..e156fabe37b 100644
--- a/ports/servo/Cargo.toml
+++ b/ports/servo/Cargo.toml
@@ -13,6 +13,15 @@ path = "main.rs"
test = false
bench = false
+[target.'cfg(windows)'.build-dependencies]
+winres = "0.1"
+
+[package.metadata.winres]
+FileDescription = "Servo"
+LegalCopyright = "© The Servo Project Developers"
+OriginalFilename = "servo.exe"
+ProductName = "Servo"
+
[features]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
diff --git a/ports/servo/build.rs b/ports/servo/build.rs
index 860617cdaf2..63558909169 100644
--- a/ports/servo/build.rs
+++ b/ports/servo/build.rs
@@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#[cfg(windows)]
+extern crate winres;
+
use std::env;
use std::path::Path;
use std::process;
@@ -13,6 +16,14 @@ fn main() {
if target.contains("android") {
android_main()
}
+
+ #[cfg(windows)]
+ {
+ let mut res = winres::WindowsResource::new();
+ res.set_icon("../../resources/Servo.ico");
+ res.set_manifest_file("platform/windows/servo.exe.manifest");
+ res.compile().unwrap();
+ }
}
fn android_main() {
diff --git a/components/servo/servo.exe.manifest b/ports/servo/platform/windows/servo.exe.manifest
similarity index 96%
rename from components/servo/servo.exe.manifest
rename to ports/servo/platform/windows/servo.exe.manifest
index 198d8d51709..23b2abe1b72 100644
--- a/components/servo/servo.exe.manifest
+++ b/ports/servo/platform/windows/servo.exe.manifest
@@ -17,8 +17,7 @@
- true
+ true
-
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 967e8c35509..f1ed3f885fa 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -354,9 +354,6 @@ class MachCommands(CommandBase):
if status == 0:
if sys.platform == "win32":
servo_exe_dir = path.join(base_path, "debug" if dev else "release")
- # On windows, copy in our manifest
- shutil.copy(path.join(self.get_top_dir(), "components", "servo", "servo.exe.manifest"),
- servo_exe_dir)
msvc_x64 = "64" if "x86_64" in (target or host_triple()) else ""
# on msvc builds, use editbin to change the subsystem to windows, but only
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py
index 2a2f2f74d8c..8fb97e9eb70 100644
--- a/python/servo/package_commands.py
+++ b/python/servo/package_commands.py
@@ -317,7 +317,6 @@ class PackageCommands(CommandBase):
dir_to_resources = path.join(dir_to_temp_servo, 'resources')
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
shutil.copy(binary_path, dir_to_temp_servo)
- shutil.copy("{}.manifest".format(binary_path), dir_to_temp_servo)
copy_windows_dependencies(target_dir, dir_to_temp_servo)
change_prefs(dir_to_resources, "windows")
diff --git a/support/windows/Servo.wxs.mako b/support/windows/Servo.wxs.mako
index a2a62ccb581..69cd69a4a1b 100644
--- a/support/windows/Servo.wxs.mako
+++ b/support/windows/Servo.wxs.mako
@@ -36,8 +36,7 @@
Directory="ProgramMenuDir"
Name="Servo Tech Demo"
WorkingDirectory="INSTALLDIR"
- Icon="Servo.ico"
- IconIndex="0"
+ Icon="servo.exe"
Advertise="yes"/>
${include_dependencies()}
@@ -70,7 +69,7 @@
-
+
<%!