I have a C++ project and I want to change the EXE file version by code.
How can I do it?
(I found some ways to do it in other languages, but not C++.)
You can use FileVersionInfo. FileVersion to fetch this from a path. ". ProductVersion" is not a "version number of a file".
Steps to Edit The Version Information 1. Open your EXE or DLL file with Rersource Tuner and expand the Version folder that’s found in the Resource Tree view, then select the version information item to be edited in the Resource Tree view. 3. Select a StringFileInfo value entry by clicking it in the displayed listview.
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > Linker > General property page. Modify the Version property. See Version.
For details, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > Linker > General property page. Modify the Version property. See Version.
Another way to insert a version number is with the VERSION module-definition statement. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > Linker > General property page.
In Solution Explorer, right click at your project -> Add -> Resource -> Version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With