How to check version info of an application programatically?
-
Hi, I would like to verify the version information of an installed application in a computer programatically (does any in built class in C# supports this). It would be great if you some one helps in this regard. Thanks in advance: Rakesh
Rakesh
Hi, this depends on the kind of application you want to check. I dont know any other standard than file versioning (for executables and dlls) which would allow to retrieve such information. If you want to check applications installed by windows installer there is a way to retrieve the information by using wmi if i remember right. All together there is no "in-built" class for such things and as far as i know you will have to create your own classes to retrieve these information.
-
Hi, this depends on the kind of application you want to check. I dont know any other standard than file versioning (for executables and dlls) which would allow to retrieve such information. If you want to check applications installed by windows installer there is a way to retrieve the information by using wmi if i remember right. All together there is no "in-built" class for such things and as far as i know you will have to create your own classes to retrieve these information.
-
Thanks for responding, My application do not use Windows Installer, so as per you I need to write a class of my own. So I would like to know how can I access these version info in my class, can you be broad in this...
Rakesh
I've been googling for retrieving the "standard" product version info of a exe/dll and found a forum post pointing to this article. The third example describes how to retrieve the version info by using the windows api (unsafe code). It's a bit complex but pretty self-explanatory. let me know if you don't get it and good luck so far :) MSDN - C# Unsafe Code Tutorial
-
Thanks for responding, My application do not use Windows Installer, so as per you I need to write a class of my own. So I would like to know how can I access these version info in my class, can you be broad in this...
Rakesh
Hi! In this case you can use the
AssemblyName.Version
property. If you have the path to your assembly (doesn't matter if it's an exe or a dll), you can callAssemblyName.GetAssemblyName(pathToAssembly);
to retrieve theAssemblyName
instance.Regards, mav -- Black holes are the places where God divided by 0...