-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
Icon for odin.exe #2600
Icon for odin.exe #2600
Conversation
We may want to check that |
misc/odin_filereg.bat
Outdated
|
||
:add_file_reg | ||
if not defined ODIN_ROOT ( | ||
echo ODIN_ROOT is NOT defined |
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.
I have added a check here for the ODIN_ROOT env. var and bail out
misc/odin_filereg.bat
Outdated
if not defined ODIN_ROOT ( | ||
echo Environment variable ODIN_ROOT is NOT defined, set it to the folder path for Odin.exe | ||
echo This can be done by executing the following command: | ||
echo setx ODIN_ROOT %CD% |
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.
check for ODIN_ROOT with an explanation on how to set it using setx
misc/odin_filereg.bat
Outdated
echo This can be done by executing the following command: | ||
echo setx ODIN_ROOT %CD% | ||
) else ( | ||
odin.exe report |
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.
if ODIN_ROOT is defined a call to odin.exe report is made this will check if the path for ODIN_ROOT exists
128e6f3
to
806b596
Compare
I'll rethink this and get back with a better "solution" I think we have enough in sys/windos to code this in odin instead of using .reg files. |
806b596
to
171d917
Compare
fyi i have repushed the brach, removed the .bat files for file registration it was not really good. will try to implement it in odin instead ;) i ended up adding a manifest file and embed that during build, this should signal to windows that we prefer an UTF-8 codapge. adding all this info seems to make windows defender less upset with odin compiled exe files :p |
I've given it a quick read and it looks really great. I'll evaluate it (try it out) tomorrow, but I'm for this in principle. (And I'm glad the |
I wonder if we shouldn't have And/or maybe add another custom field We'll have to give it some thought. I don't know yet how we'll want to version our post-1.0 releases, and it may be good for @gingerBill to weigh in on that so we can incorporate that knowledge in this PR, and not run into "2024.08.24 > 1.2026.02.13" issues if we don't have to. One option is to categorically state that all versions will be YYYY-MM-DD based, even after 1.0, and then the 4-field version could in fact be |
build.bat
Outdated
@@ -53,18 +53,29 @@ rem See https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-a | |||
set compiler_flags= %compiler_flags% /utf-8 | |||
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\" | |||
|
|||
rem fileversion is defined as {Major,Minor,Build,Private: u16} so a bit limited | |||
set rc_flags=-nologo -v ^ |
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.
i tried to keep the output to a minimum, not sure if the -v
here is good here, it will output
[vcvarsall.bat] Environment initialized for: 'x64'
Using codepage 1252 as default
Creating misc\odin.res
misc\odin.rc.
Writing VERSION:1, lang:0x409, size [10](https://github.com/odin-lang/Odin/pull/2600/checks#step:3:11)16.
Writing ICON:1, lang:0x409, size 2216
Writing ICON:2, lang:0x409, size [13](https://github.com/odin-lang/Odin/pull/2600/checks#step:3:14)84
Writing GROUP_ICON:101, lang:0x409, size 34.
Writing ICON:3, lang:0x409, size 22[16](https://github.com/odin-lang/Odin/pull/2600/checks#step:3:17)
Writing ICON:4, lang:0x409, size 1384
Writing GROUP_ICON:102, lang:0x409, size 34
main.cpp
libtommath.cpp
Parsing of manifest successful.
good call with the 0 prefix |
I took it up with Bill, and we've landed on: |
But let's do this for release builds only, so the YYYY-MM format, and let's drop doing this on nightly/dev builds. For one, most people who use a pre-built Odin use the monthly version, and it's also easy enough to build from source. I've yet to see Defender complain about an executable generated by |
@Kelimion I think this pr is as ready as I can make it :) |
Wanted to explore how Odin was handling windows resources and luckily it was very easy :)
For testing I ended up adding 2 icons to Odin.exe (based on the emblem in artwork) and kinda liked it and thought it was worth sharing.
This can maybe also serve as a "self test" of the resource feature. btw really nice we don't have to call the rc tool and it just build-in. Both icon files only contain a 16x16 and 32x32 to keep them small 3.5 KB as they are embedded in the exe. I used the 2nd icon for .odin files.
It made the compiler stand out nicely :) But this is ofc only interesing on windows so I understand this might not be the time for things like this ;)