How do I change an EXE or DLL version number from the command line?
-
03-07-2019 - |
Question
I need to build an old VB6 application with a version number where the 4th digit is greater than 9999, for example, version 1.2.0.10003
. VB6 won't let you do this; the build fails.
The current workaround is to build version 1.2.0.9999
and then manually edit the file in Visual Studio to insert the correct version. There must be a better way. Is there a command-line tool that allows you to modify the version number fields of an EXE or DLL? Preferably a way that allows you to edit specific version number fields individually.
Solution
There are a number of tools for editing the version info of a windows executable but I don't think you will need them.
Look here are using resource files in vb http://visualbasic.about.com/od/usevb6/a/ResVB6.htm
And here for info on the version resource http://msdn.microsoft.com/en-us/library/aa381058.aspx
And here for info on the microsoft resource compiler http://msdn.microsoft.com/en-us/library/aa381042(VS.85).aspx
With these two you should be able to disable VB's builtin versioning and use whatever version info you want.
Nevermind, VB6 inserts its own version resource as a post build operation with no way to turn it off. Overwriting the version info in the executable is the only solution.
OTHER TIPS
ChangeVersion (and others) taken from:
How do I set the version information for an existing .exe, .dll?
This console resource editor allows creating a reliable and repeatable process for updating Product Version Information resources during the final stage of the build process from the command prompt.
See specifically the batch manipulation of file version information page for greater details:
I think editbin
might be a better solution (installed with Visual Studio)