[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2249
  • Last Modified:

VC++ : How to change the executable file version?

Hi,

Could any one tell me how to change the file version in VC++? I have tried by changing the Version value in Project Properties->Linker->Version but still it is saying old version when I right click on executable and see the version tab's File Version info. but it displays correct version in "Item name's File Version info'

Please refer the attached snapshot of properties dialog.
Thanks,
fileVersion.JPG
0
deshaw
Asked:
deshaw
3 Solutions
 
AndyAinscowCommented:
resource editor - version resource.  Modify the value there.
0
 
SreejithGCommented:
If you have a resource (.rc) file update the version as mentioned above. If not create one rc file and add the below code and update the version etc in th erc file.
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
 
VS_VERSION_INFO     VERSIONINFO
  FILEVERSION       1,0,0,1
  PRODUCTVERSION    1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
	BLOCK "StringFileInfo"
	BEGIN
        BLOCK "040904B0"
		BEGIN 
			VALUE "CompanyName",     "\0"
			VALUE "FileDescription", "Sample MFC Application\0"
			VALUE "FileVersion",     "1, 0, 0, 1\0"
			VALUE "InternalName",    "Sample \0"
			VALUE "LegalCopyright",  "Copyright (C) 2008\0"
			VALUE "LegalTrademarks", "\0"
			VALUE "OriginalFilename","Sample.EXE\0"
			VALUE "ProductName",     "Sample Application\0"
			VALUE "ProductVersion",  "1, 0, 0, 1\0"
		END
	END
	BLOCK "VarFileInfo" 
	BEGIN 
		VALUE "Translation", 0x409, 1200
    END
END

Open in new window

0
 
Deepu AbrahamR & D Engineering ManagerCommented:
Well, The .rc2 file is meant for user-defined resources

Have a look at this link:
http://support.microsoft.com/kb/237870

Hope this helps.
Best Regards,
DeepuAbrahamK
0
 
deshawAuthor Commented:
I have already updated resource .rc file and thats a resaon I am getting correct version 4.1.3 in Items name list but at the top still I am getting 4.1.1 Please refer the figure I have attached in original reply.
0
 
deshawAuthor Commented:
The tricky part was opening a .rc file using resource editor by right clicking resourec file->open with and select resource editor. I have made it default now. Thanks Guys for helping me out.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now