473,765 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to programmaticall y check for versions of software

What are some good ways to programmaticall y check for software already
installed on a computer?

For example, to check a version of Internet Explorer, a program can check
the registry for the following value:
[HKLM\SOFTWARE\M icrosoft\Intern et Explorer] Version, and see if the version
is 6.0 or not.

However, not all installed software can be checked as easily. For example,
Windows Media Player 9 has the following registry path:
[HKLM\SOFTWARE\M icrosoft\MediaP layer\9.0\Regis tration] UDBVersion, which one
can use to see which version of WMP9 is installed. However, when version 10
does come out, one does not really know if it will use the same pattern for
registry path.

The biggest problem, perhaps, is that registry paths remain in the registry
even after a program is uninstalled. For example, one may want to check if
a program is installed simply by checking for the existence of a registry
path. But sometimes, uninstalling a program WILL NOT remove the registry
entries, and so, the program will incorrectly believe the software is
already installed.

Maybe my approach is wrong. Perhaps relying on the registry is not 100%
proof. Please suggest better ways for programmaticall y checking for
versions of software installed on a computer. Thanks.

Nov 16 '05 #1
2 8126
Jak Sparrow wrote:
What are some good ways to programmaticall y check for software already
installed on a computer?

For example, to check a version of Internet Explorer, a program can check
the registry for the following value:
[HKLM\SOFTWARE\M icrosoft\Intern et Explorer] Version, and see if the version
is 6.0 or not.

However, not all installed software can be checked as easily. For example,
Windows Media Player 9 has the following registry path:
[HKLM\SOFTWARE\M icrosoft\MediaP layer\9.0\Regis tration] UDBVersion, which one
can use to see which version of WMP9 is installed. However, when version 10
does come out, one does not really know if it will use the same pattern for
registry path.

The biggest problem, perhaps, is that registry paths remain in the registry
even after a program is uninstalled. For example, one may want to check if
a program is installed simply by checking for the existence of a registry
path. But sometimes, uninstalling a program WILL NOT remove the registry
entries, and so, the program will incorrectly believe the software is
already installed.

Maybe my approach is wrong. Perhaps relying on the registry is not 100%
proof. Please suggest better ways for programmaticall y checking for
versions of software installed on a computer. Thanks.


If you look at the file properties in Windows Explorer, you will see
that each file has a version attribute attached to it.

So

(a) Find the actual executable
(b) Use the File or FileInfo class to read the version attribute.
Nov 16 '05 #2
Hi Jak,

"Jak Sparrow" <no@spam.net> wrote in message
news:up******** ******@TK2MSFTN GP11.phx.gbl...
What are some good ways to programmaticall y check for software already
installed on a computer?

<snip>

WMI (System.Managem ent namespace) is a good tool for this sort of task.
Just to give you an idea:

...
// need a "using System.Manageme nt;" somewhere
// and a reference to System.Manageme nt.dll
static void ListAllProducts ()
{
SelectQuery allProductsQuer y = new SelectQuery("Wi n32_Product");

ManagementObjec tSearcher allProducts =
new ManagementObjec tSearcher(allPr oductsQuery);

foreach(Managem entObject product in allProducts.Get ())
{
Console.WriteLi ne("Product {0} is at version {1}",
product.Propert ies["Name"].Value,
product.Propert ies["Version"].Value);
}
}
...

Regards,
Daniel
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1820
by: Oliver Elphick | last post by:
The attached proposal is written primarily for Debian. Its motivation is that the current package upgrade process is pretty flaky and also that the current packaging does not really provide for multiple simultaneous postmasters, which are wanted by people hosting several database clusters. I assume these proposals may also be of interest to Red Hat packagers. I am copying it to the PostgreSQL list in case there are any obvious...
2
4181
by: Atul | last post by:
Hi, How can I "disable script debugger" programmatically using C#? Its similar action when we check the check box from IE (Tools | Internet Options...| Advanced). Any ideas??? Thanks Atul
13
2579
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
2
3817
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens provide text area where the user can insert big chunks of text and submit it all to the server paragraph by paragraph. The requirement is to do a Spell Check AND Grammar Check in the text area. I did look at lot of possible third
6
11562
by: Matt Frame | last post by:
I have a client that has asked us to get a digital signature certificate and start digitally signing all files we pass between each other. I have heard of the subject and know about the certs but I have no idea how to do something like this with VB.Net. Has anyone done something like this or know where I can find out information how to perform the process of signing a document when sending it then checking one on receipt? Your help is...
4
4298
by: Maxwell2006 | last post by:
Hi, I am struggling with making my website compatible with multiple browsers and versions. Is there any tool that shows me how my pages look like in different browsers
3
2646
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a CssClass to them, or programmatically making the Visible/not Visible. If applied to a containing page, such a function would traverse all user controls statically and dynamically placed on the page, correct? Thanks,
8
3891
by: Chandra | last post by:
How do I programmatically (javascript) check if link is valid in html?
4
12439
by: pwu | last post by:
Hi, I am doing an automated scan of a large number of UNIX machines which can be Solaris, AIX or HPUX. I want to find out for a machine via a script if: 1) DB2 is installed? 2) If installed what version is installed What file/process/user can I check to achieve this?
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.