diff --git a/Cargo.lock b/Cargo.lock index fe6c0b5204..76d03ef719 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -925,6 +925,19 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "embed-resource" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e813aabad49e547de6abcc81004dfced79226fb3a14d73c26aabc2816ee8c7f" +dependencies = [ + "cc", + "rustc_version", + "toml", + "vswhom", + "winreg 0.10.1", +] + [[package]] name = "eml-parser" version = "0.1.2" @@ -2123,6 +2136,7 @@ dependencies = [ "crossterm", "crossterm_winapi", "ctrlc", + "embed-resource", "hamcrest2", "is_executable", "itertools", @@ -3471,7 +3485,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "winreg 0.7.0", ] [[package]] @@ -4530,6 +4544,26 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22025f6d8eb903ebf920ea6933b70b1e495be37e2cb4099e62c80454aaf57c39" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "vte" version = "0.10.1" @@ -4836,6 +4870,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + [[package]] name = "xmlparser" version = "0.13.3" diff --git a/Cargo.toml b/Cargo.toml index 219567ec9b..f5f48de66a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,9 @@ hamcrest2 = "0.3.0" rstest = "0.12.0" itertools = "0.10.3" +[target.'cfg(windows)'.build-dependencies] +embed-resource = "1" + [features] plugin = ["nu-plugin", "nu-parser/plugin", "nu-command/plugin", "nu-protocol/plugin", "nu-engine/plugin"] default = ["plugin", "inc", "example", "which"] diff --git a/assets/nu_logo.ico b/assets/nu_logo.ico new file mode 100644 index 0000000000..719d85f919 Binary files /dev/null and b/assets/nu_logo.ico differ diff --git a/assets/nushell.rc b/assets/nushell.rc new file mode 100644 index 0000000000..3e01c0fd00 --- /dev/null +++ b/assets/nushell.rc @@ -0,0 +1,50 @@ +#include +#include + +#define VER_FILEVERSION 0,59,1,0 +#define VER_FILEVERSION_STR "0.59.1" + +#define VER_PRODUCTVERSION 0,59,1,0 +#define VER_PRODUCTVERSION_STR "0.59.1" + +#ifdef RC_INVOKED + +#ifdef DEBUG // TODO: Actually define DEBUG +#define VER_DEBUG VS_FF_DEBUG +#else +#define VER_DEBUG 0 +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS VER_DEBUG +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "nushell" + VALUE "FileDescription", "Nushell" + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", "nu.exe" + VALUE "LegalCopyright", "Copyright (C) 2022" + VALUE "OriginalFilename", "nu.exe" + VALUE "ProductName", "Nushell" + VALUE "ProductVersion", VER_PRODUCTVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#define IDI_ICON 0x101 +IDI_ICON ICON "assets/nu_logo.ico" +#endif \ No newline at end of file diff --git a/build.rs b/build.rs new file mode 100644 index 0000000000..7b2ee7082a --- /dev/null +++ b/build.rs @@ -0,0 +1,7 @@ +#[cfg(windows)] +fn main() { + embed_resource::compile_for("assets/nushell.rc", &["nu"]) +} + +#[cfg(not(windows))] +fn main() {}