0

i want to detect installed games on a system and show it in a listbox. I think the best thing I can do is scan specific parts of registry and look for key names that match with a List of Publishers.

But how i can do it?

Im trying this, but that's show all of programs installed.

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim regkey, subkey As Microsoft.Win32.RegistryKey
    Dim value As String
    Dim regpath As String = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
    regkey = My.Computer.Registry.LocalMachine.OpenSubKey(regpath)
    Dim subkeys() As String = regkey.GetSubKeyNames
    Dim includes As Boolean
    For Each subk As String In subkeys
        subkey = regkey.OpenSubKey(subk)
        value = subkey.GetValue("DisplayName", "")
        If value <> "" Then
            includes = True
            If value.IndexOf("Hotfix") <> -1 Then includes = False
            If value.IndexOf("Security Update") <> -1 Then includes = False
            If value.IndexOf("Update for") <> -1 Then includes = False
            If includes = True Then ListBox1.Items.Add(value)

        End If

Thanks.

0 Answers0