Whether application is installed in workstation


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Whether application is installed in workstation

  1. #1
    Join Date
    Jun 2004
    Posts
    288

    Whether application is installed in workstation

    How can we know whether certain application is installed in a workstation?
    Should we search the registry?

  2. #2
    Join Date
    Dec 2003
    Posts
    83
    This VB.NET code will show you all the software installed on the computer that shows up in the Add/Remove Programs list. You can do a little modification and look for something specific.

    You will need to import Microsoft.Win32 then place this code in a blank project's Form_Load event.

    Code:
    Dim RKey As RegistryKey
    Dim RKeyV As String
    Dim SubKey As String = ""
    RKeyV = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
    RKey = Registry.LocalMachine.OpenSubKey(RKeyV, False)
    For Each SubKey In RKey.GetSubKeyNames()
      Dim TmpKey As RegistryKey = RKey.OpenSubKey(SubKey)
      If (Not TmpKey Is Nothing) Then
        If (Not TmpKey.GetValue("DisplayName") Is Nothing) Then
          MsgBox(TmpKey.GetValue("DisplayName"))
        End If
      End If
    Next
    RKey.Close()
    Last edited by howiegoo; 04-21-2005 at 06:23 PM.

  3. #3
    Join Date
    Dec 2003
    Posts
    83
    I have no idea why this message board is placing a space in the middle of the word "Uninstall" in the code I posted above. Obviously there should be no space there.

  4. #4
    Join Date
    Jun 2004
    Posts
    288
    Which library contains the functions such as 'RegistryKey'. I referenced the 'Registry Access Functions'; but it does not contain all the functions used in the code.

  5. #5
    Join Date
    Dec 2003
    Posts
    83
    You have to import Microsoft.Win32 by placing this line at the very top of the code window (before the class code starts).

    Imports Microsoft.Win32

    I didn't have to change any references.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center