Answered by:
Setting the Version Information in the exe file

Question
-
I am currently using the express edition of Visual C++ 2005. Is there any way of setting the version number, description, company, etc. that appear in the Version tab of the properties dialog of the exe?
There doesn't appear to be a resource editor in the express edition. Is there an alternative or would I need to upgrade to the full Visual Studio to do this?
Mog0Thursday, November 17, 2005 6:35 PM
Answers
-
http://msdn.microsoft.com/library/en-us/tools/tools/versioninfo_resource.asp
Sample:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,2,0
PRODUCTVERSION 2,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040704e4"
BEGIN
VALUE "CompanyName", "MR-Software, 63571 Gelnhausen, Germany"
VALUE "Copyright (C) 2002", "(c) 2002 by Martin Richter. All rights reserved."
VALUE "FileDescription", "x"
VALUE "FileVersion", "2.02.002"
VALUE "InternalName", "x.exe"
VALUE "OriginalFilename", "x.exe"
VALUE "ProductName", "x"
VALUE "ProductVersion", "2.02"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x407, 1252
END
ENDFriday, November 18, 2005 10:55 PM -
I did get it working. I just added a file to my project from within VC++ Express Edition and named it version.rc and pasted the example given above by Martin Richter into it.
I did have to change the string "VS_VERSION_INFO" to "1" before it worked but after that, Rebuilding my app gave me the Version tab.
My modified version is now:
1 VERSIONINFO
#ifdef _DEBUG
FILEVERSION 0,0,0,1
PRODUCTVERSION 0,0,0,1
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904e4"
BEGIN
VALUE "CompanyName", "Company"
VALUE "LegalCopyright", "(c) 2005 Company. All rights reserved."
VALUE "FileDescription", "RSS0 Aggregator"
VALUE "FileVersion", "0.0.0.1"
VALUE "InternalName", "RSS0"
VALUE "OriginalFilename", "RSS0.exe"
VALUE "ProductName", "RSS0"
VALUE "ProductVersion", "0.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1252
END
END
Mog0Monday, November 21, 2005 10:41 PM
All replies
-
Create manual a resource file and place the version info block into it. Add this to the project. Done!
The resource editor is not part of the express version!Friday, November 18, 2005 9:11 AM -
Do you know anywhere I can find out about the format of the version info block?
Mog0Friday, November 18, 2005 6:27 PM -
http://msdn.microsoft.com/library/en-us/tools/tools/versioninfo_resource.asp
Sample:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,2,0
PRODUCTVERSION 2,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040704e4"
BEGIN
VALUE "CompanyName", "MR-Software, 63571 Gelnhausen, Germany"
VALUE "Copyright (C) 2002", "(c) 2002 by Martin Richter. All rights reserved."
VALUE "FileDescription", "x"
VALUE "FileVersion", "2.02.002"
VALUE "InternalName", "x.exe"
VALUE "OriginalFilename", "x.exe"
VALUE "ProductName", "x"
VALUE "ProductVersion", "2.02"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x407, 1252
END
ENDFriday, November 18, 2005 10:55 PM -
Thanks this looks like just what I wanted. I shall give it a try.
Mog0Friday, November 18, 2005 11:48 PM -
Hi Mog0
Did you get that to work properly? My first attempt did not result in the the wanted version-tab, but I guess some of the values just has to be adjusted according to the documentation. I asked you because I needed a confirmation that this can be done by hand at all.
Regards SDYMonday, November 21, 2005 10:30 PM -
I did get it working. I just added a file to my project from within VC++ Express Edition and named it version.rc and pasted the example given above by Martin Richter into it.
I did have to change the string "VS_VERSION_INFO" to "1" before it worked but after that, Rebuilding my app gave me the Version tab.
My modified version is now:
1 VERSIONINFO
#ifdef _DEBUG
FILEVERSION 0,0,0,1
PRODUCTVERSION 0,0,0,1
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904e4"
BEGIN
VALUE "CompanyName", "Company"
VALUE "LegalCopyright", "(c) 2005 Company. All rights reserved."
VALUE "FileDescription", "RSS0 Aggregator"
VALUE "FileVersion", "0.0.0.1"
VALUE "InternalName", "RSS0"
VALUE "OriginalFilename", "RSS0.exe"
VALUE "ProductName", "RSS0"
VALUE "ProductVersion", "0.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1252
END
END
Mog0Monday, November 21, 2005 10:41 PM -
Zap! That worked. Chears.
I just had to change this also:
FILETYPE 0x2L
because my target is a dll.
/SDYMonday, November 21, 2005 11:29 PM -
Hello
I am working in c#.
When i open my the help of my application the help window opens up with my wizard showng the count (2).I need to name this group but not able to find how to group this.Just in the way if anyone opens up InternetExplorer 5-6 times all the windows are grouped together and shows (6)InternetExplorer.
Can somebody please help me out.
ThanksWednesday, December 7, 2005 5:52 AM -
Are you searching for this?
http://blogs.msdn.com/oldnewthing/archive/2004/04/08/109775.aspx
Use the filedescritption field!Wednesday, December 7, 2005 7:24 AM -
Yes,That is the correct way.
I did it but was not getting the group name.
I found the following sol.
In .NET this is the AssemblyTitle. If you already have run the executable, then modify the EXE will not modify the group name. That's because Explorer has cached the group name in the Registry.HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache
Go to this Registry hive and delete the relevant group name.
By doing this I was able to get the groupname.
But I have done this by setting the FileDescription in AssebmlyInfo which does not get executed by CoreXT.Can u suggest me how to set the FileDescription through CoreXT?
ThanksWednesday, December 7, 2005 8:20 AM -
Can you use this versioninfo file to set the fields under the summary tab of the file properties? Or is there some other way of adding the data when you build the file?Monday, April 14, 2008 1:20 AM
-
Thank you guys! I was wondering how to do this. :3Friday, July 31, 2009 4:50 PM