-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
base: master
Are you sure you want to change the base?
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.
see https://github.com/odin-lang/Odin/pull/2600/checks
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 |
Wanted to explore how Odin was handling windows resources and luckily it was very easy :)
![odin_with_icon](https://private-user-images.githubusercontent.com/5068078/248018360-2608c92f-d183-471e-8455-6580890c5adf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxMTQ5NDgsIm5iZiI6MTcyNjExNDY0OCwicGF0aCI6Ii81MDY4MDc4LzI0ODAxODM2MC0yNjA4YzkyZi1kMTgzLTQ3MWUtODQ1NS02NTgwODkwYzVhZGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTJUMDQxNzI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTY5M2RkODAzMjFmZDJiMjBlNTgwODRlNTgyYzk1ODkxYWY5ZWQzZWZkN2I2NTMwZTAzYzMxMWQwOTJhMzI2MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.-eXsp_BgvVXMJu_LfkSUSDYuVdumh-04PhqNxkfya8g)
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 ;)