-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature]Add version info into dll and exe under Windows #14
Comments
Good suggestion! I don't know how to do it with simple solution on shell scripting and/or 3rd party tools. Bit off topic: I know (but only user side) text based generator likely it in configure script by autoconf/automake. If not wrong my understanding, it has very complex sed/awk based script... I think a solutions is: it makes (with sed?) from a template resource script text with variable version string, and variable string comes from building script (build.sh) entering MANUALLY (Yes, it isn't elegant :) : LIBFDK=2.0.2
FDKAAC=1.0.2
#...
sed -e 's/LIBFDK/${LIBFDK}/g' version.template | sed -e 's/FDKAAC/${FDKAAC}/g' > version.rc
# TODO: How to insert resource bin into?
make -j$NPB |
I don't know anything about regular expressions and text processing, but I can provide some ways to use tools to add version information. Generally speaking, there are two implementation paths. One is to inject the version information into the compiled file through a third-party tool like Resource Hacker; Another method is to modify makefile.ac of the original project and add But anyway, both of these two methods need a 1.Writing resource.rchttps://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/
https://stackoverflow.com/questions/46430483/version-info-exe-with-gcc-and-windres In this discussion, someone said it should use
For all available items in .rc file, could refer to the Microsoft documentation. 2.1. Inject version info to binary filesWe need a ResourceHacker.exe. And add these to
More info about the command line syntax of Resource Hacker could be found on their official site. 2.2. Add version info during compile2.2.1. Manually add version infoAfter some searching, I think the most concise tutorial I found is this one, it should be read first. (a) Compile the .rc file:
Here is the man page of (b) Link everything: 2.2.2. Add version info using autotoolsThe above two steps are simple, but I don't know how to use autotool to complete the above process. Maybe the first concise tutorial is a good start.
Here autotools tags for compiling resources is another (maybe usefull) discussion. |
Since this project only compile for stable release version, we could somehow use their existing version number definition. In fdkaac, the author defines the version number in https://github.com/nu774/fdkaac/blob/347e995cfc44941f6d6dfe8d4e09362a71ea8d26/version.h#L1-L4
https://github.com/nu774/fdkaac/blob/fdf5c2f251a6b35dc2b3df561cfd247829b98f5d/configure.ac#L1-L6 In fdk-aac, the author defines the version number both in https://github.com/mstorsjo/fdk-aac/blob/801f67f671929311e0c9952c5f92d6e147c7b003/configure.ac#L29
So, I think we should modify their |
Now fdkaac.exe will display version info normally in my Windows. I've tested my modify in https://github.com/nkh0472/fdkaac/tree/patch-1. Please help me to see if the file display in the English system is normal. PS: |
It is very useful for compiling under Windows system, but may need do a little patch like adding a header file or/and patch the configure file…… Of course, a new third-party tool also could be used to modify the compiled file, which will not affect the source code and compilation process, but the implementation is not so elegant.
It could be implemented by upstream developers or in this compiler script.
Some useful links:
https://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/
https://stackoverflow.com/questions/2618669/compiling-dll-with-version-information
https://stackoverflow.com/questions/3314800/how-to-embed-version-information-into-shared-library-and-binary
The text was updated successfully, but these errors were encountered: