Skip to content

Commit

Permalink
Add icon to servo.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
UK992 committed Mar 17, 2018
1 parent 1ae5715 commit 13ce5c2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions ports/servo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
11 changes: 11 additions & 0 deletions ports/servo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

3 changes: 0 additions & 3 deletions python/servo/build_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion python/servo/package_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 2 additions & 3 deletions support/windows/Servo.wxs.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down Expand Up @@ -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>
<%!
Expand Down

0 comments on commit 13ce5c2

Please sign in to comment.