Can anyone please tell me how to update an existing exe's file version?

Ex. Target.exe exists. It may or may not have a file version. The source code is NOT available.

I need be able to change the file version.

Thanks!!!!

All the .NET methods and properties, that access file version data, are ReadOnly.

Do you have only a single file to modify? If so, have you tried some hex editor (without messing up the original file of course)?

No it is NOT one.

I need an programmatic way of doing it. I am trying to set other exes to the Applications file version so they are all in sync.

The other exe's can be whatever exes the program needs include a Self Extracting Zip exe.

Thanks

Ok, the next way to do it would be with Windows API calls. There are API calls GetFileVersion (or GetFileVersionInfo).

However, there's no SetFileVersion API call. Well, at least I didn't find anything like that.

Finally I found StampVer, a freeware utility to change version resource of a Win32 executable (there may be other similar tools). Since it seems quite impossible to use VB.NET directly, could it be possible to use a third-party tool. Now you could call the utility with Shell or use System.Diagnostics.Process class.

That works but it would be nicer if I know the code to invoke rather and creating an interface to another process that is out of our control.

But thanks it does solve the problem (for now).

Sorry but I have to take it back.

It does not put in a file version UNLESS there was already one there.

So I am back to Square 1.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.