• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2285
  • 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
 
AndyAinscowFreelance programmer / ConsultantCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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