-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add icon to Windows executable #9104
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
527be32
to
5cb23d4
Compare
29fc686
to
81c0985
Compare
a03d693
to
3aaa895
Compare
I am personally not a fan of pulling in an extra dependency for something that IMO has very little practical use. Nobody start a TUI application from clicking on it, especially because you would need to run it inside a terminal emultor (so the shortcut would have the icon of the terminal emulator). |
There's another approach that doesn't use external crates.. have to check: https://stackoverflow.com/a/76500197 |
69c9d6c
to
d474112
Compare
that's awesome @NewtonChutney - and if you urself hid that comment as OT, then i think u should unhide it. |
This comment was marked as off-topic.
This comment was marked as off-topic.
and actually, i didn't bother with calculations back then... but today:
$ eza -lB logo.svg # Original (master branch)
-a--- 2,848 18 Dec ... logo.svg
$ eza -lB logo.svg # Add Newlines, Remove trailing whitespace
-a--- 2,709 18 Dec ... logo.svg
$ eza -lB logo.svg # Add 2nd level tab indentation
-a--- 2,751 18 Dec ... logo.svg
$ eza -lB logo.svg # FInal: Pretty root svg tag - newlines to attributes
-a--- 2,755 18 Dec ... logo.svg
$ # -----------------------------------------------------------------
$ eza -lB logo.svg # JUST FOR RECORDS - "convert indentation to spaces"
-a--- 2,886 18 Dec ... logo.svg
$ eza -lB logo.svg # JUST FOR RECORDS - pr #5941
-a--- 2,989 18 Dec ... logo.svg
$ eza -lB logo.svg # JUST FOR RECORDS - pr #5941, but now with "convert indentation to tabs"
-a--- 2,785 18 Dec ... logo.svg |
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been minimized.
This comment has been minimized.
By the logs I see the CI pipeline couldn't take the file.. |
The relative upper directory println!("cargo:rustc-link-lib=../contrib/helix-icon-windows"); but println!("cargo:rustc-link-lib=./contrib/helix-icon-windows"); The attempt with subpath from the root: println!("cargo:rustc-link-lib=contrib/helix-icon-windows"); |
No luck.. I'd need help fixing this! |
This is just how rust buildscripts work. Depending on how cargo is I.voked the cwd is different you cant make assumptions about that. You will need to use the environment variables set by cargo |
This comment was marked as resolved.
This comment was marked as resolved.
ff7c6c6
to
f545704
Compare
Thanks for the tip @pascalkuthe I hope this works.. one more test..? :-) |
f545704
to
9aa49ca
Compare
I have pushed again after formatting, could you run the workflow again and do a final review? @the-mikedavis @pascalkuthe |
I am not quite comfortable committing an opaque binary to the repo. Could we build the .lib file by invoking rc from build.rs? |
Yes, but we'll have to do similarly to the winres crate.. Parse regedit for entries, and check if the binary exists.. |
I think you can just use |
I'm having difficulty utilizing this function: get_sdk10_dir() which is in the source code of It appears to be part of this module.. But there's no way to instantiate/utilize it? |
yeah that is private API I assume that you could just use |
Yepp, I'll copy the minimum required from winres |
@pascalkuthe, please do take a look now.. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks mostly good to me the amount of code would be ok as long as you feature gate it so other platforms are not slowed down (see comments)
49b6165
to
3203722
Compare
It appears the Cachix workflow *was failing.. |
* injecting the icon through a resource file, no extra deps * formatted * scripted rc compilation * formatted and restructured * simplified conditional func call
* injecting the icon through a resource file, no extra deps * formatted * scripted rc compilation * formatted and restructured * simplified conditional func call
* injecting the icon through a resource file, no extra deps * formatted * scripted rc compilation * formatted and restructured * simplified conditional func call
* injecting the icon through a resource file, no extra deps * formatted * scripted rc compilation * formatted and restructured * simplified conditional func call
* injecting the icon through a resource file, no extra deps * formatted * scripted rc compilation * formatted and restructured * simplified conditional func call
This PR changes the build to include an icon for the Windows executable
fixes #5940
Icon contributed by @goyalyashpal