mirror of
https://github.com/servo/servo.git
synced 2025-06-17 04:44:28 +00:00
Add icon to servo.exe
This commit is contained in:
parent
1ae5715309
commit
13ce5c239c
7 changed files with 33 additions and 9 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -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)",
|
||||
]
|
||||
|
||||
|
@ -3610,6 +3611,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"
|
||||
|
@ -3995,6 +4004,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"
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -21,4 +21,3 @@
|
|||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
</assembly>
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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>
|
||||
<%!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue