From fa7d66347fc157c69cf8f0682f6e37004ec6c554 Mon Sep 17 00:00:00 2001 From: Genna Wingert Date: Sat, 5 Mar 2022 22:56:23 +0100 Subject: [PATCH] Add basic resource file for Windows binary (#4745) --- Cargo.lock | 45 +++++++++++++++++++++++++++++++++++++++- Cargo.toml | 3 +++ assets/nu_logo.ico | Bin 0 -> 6169 bytes assets/nushell.rc | 50 +++++++++++++++++++++++++++++++++++++++++++++ build.rs | 7 +++++++ 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 assets/nu_logo.ico create mode 100644 assets/nushell.rc create mode 100644 build.rs 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 0000000000000000000000000000000000000000..719d85f919023b70f295fd596c3fe7573f257d7c GIT binary patch literal 6169 zcmc&Y_ct6|uqz@&qDOBbN?1X3tA*%gMTyRS(N^!B)gom1bRy~^dQEnf=n+v?j~axH zp4C=wyLi6yetG}Fn>ll4&Ye3m_ntZT+?fFYh;H#eAObJ}h?xKYhFcl_3amjv&O&}G zQfO(a8vdvKkI3%avPo*C=eO*>m!`Qd0PukBKOzF;Z6Dbq*l93CNy`GcqE`4vAVA*KAWGdic_Dtv3>}O3KU|ofOWv#`@w5{vw zLP1&@163NDl=nhNzO}uf;XDkUbY269?&#)`j>2s&EA9FE?hRjznnPpBZqM=m04({Z zo0NaU+M`wh{oFqT{vIxZZMP49X5|&FdVPD|*Suu*EP3=i+PSzVvgFV3%! zbsG$S4gaa_2v&W9VN6n`8y?QChgf+nFzb02{&6z?g{wnKpz_HyD4$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t-B2fMr#5(~4egTLKSi7}Wo>vNP}uCjENXV`f`w$Y{% zs+mjg&#ki(nO4LzYweY)x_y%jV(0*!94J?M$`IQ2ZYK;CzGa?qKmF686kb4HjqX}B z)QhXv&OpOkxNYu7^V>y9k>BD0gTI@lOe7kP;Ag~BW*1Um{%ROShuR0>1mS5|qk&QK zcI}DqOu}fPAFpgMOeAR@zhV7J`;_LwKh+;F8gES`{`bt-%}VMbR{1J6(LJ(}lSqa( zl|s-4U7Q0T^ReB*3AJ5YxhSnrVV|kS-TVwqnzE26_xpHVjS*>(*S+H&*~#%C4@$)CY1oxFb0De%@5%7sMIHIGVSS; z_mM_BW+lM``}dz{cF&0U6_e!)k`~P)GJT`vgVgjj-Do3pPh5Pq6^TmhH2>K` z+bNCY6QDBpi;U#dgI1-hfR%3rXV)vbS#H;CddR$xS!d`o={h5Y& zNsVWycuSIu=2tXb$uH(wtSGAtBMSVXFa(9%S5 zK4+*i=2URO_c1+F$*af(i-CYRnz>sM6EKGMjUi%#R*x`s0d?ylS+e*u z<19X)dJpdVt>a`@ zXD1&QFQw2ZrC^Vm;kkQX;MbcbEq0KtZrERzh>8GmS{ALu62A8zvt`sWIjgO4)r;H4 z=l@W$e`b=^ZOuI=mF8yy$qc-plx$T;NDa*D4phm7t5BB<7#M7_&RFZkENGNe3Bey_ z)UEk(Q}r9)Q|(3i9(Wb@l1W?uzf6nItj+*4rh6dg6yWBV? z?KuE9+u)^f?RxL*L2eITNbwHM1-wGLiU3}%7D~}O>MRR9*4Jd>nDFD0^bvC_9{_u| vM%#uO`{{F-`2O$Q{r_Qp{eMHcOy3Y!n;L~baw75nZ(U0btXik?PxSu)BiD-N literal 0 HcmV?d00001 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() {}