Skip to content
Permalink
Browse files

Add icon to servo.exe

  • Loading branch information
UK992 committed Mar 17, 2018
1 parent 1ae5715 commit 13ce5c239c6837cf265c18802bd9f084f7fd0dd0

Some generated files are not rendered by default. Learn more.

@@ -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"]
@@ -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() {
@@ -17,8 +17,7 @@

<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

@@ -354,9 +354,6 @@ def build(self, target=None, release=False, dev=False, jobs=None,
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
@@ -317,7 +317,6 @@ def package(self, release=False, dev=False, android=None, debug=False, debugger=
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")
@@ -36,8 +36,7 @@
Directory="ProgramMenuDir"
Name="Servo Tech Demo"
WorkingDirectory="INSTALLDIR"
Icon="Servo.ico"
IconIndex="0"
Icon="servo.exe"
Advertise="yes"/>
</File>
${include_dependencies()}
@@ -70,7 +69,7 @@
<ComponentRef Id="ProgramMenuDir"/>
</Feature>

<Icon Id="Servo.ico" SourceFile="${windowize(resources_path)}\Servo.ico"/>
<Icon Id="servo.exe" SourceFile="${windowize(exe_path)}\servo.exe"/>
</Product>
</Wix>
<%!

0 comments on commit 13ce5c2

Please sign in to comment.
You can’t perform that action at this time.