I just made some code for someone that lists all installed apps. I just decided to throw it in here for anyone who might be interested in using it.

It's a function, called GetInstalledApps, which returns an array with the names of all the installed apps. It should be easy enough to figure out how to use.

The code is based on information gathered from the MSDN Library. It has lots of information for people who want to make their own installers.

Here's the code:
VB Code:
  1. Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
  2. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
  3. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
  4. Private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As FILETIME) As Long
  5. Private Const HKEY_LOCAL_MACHINE = &H80000002
  6. Private Const KEY_QUERY_VALUE = &H1
  7. Private Const KEY_ENUMERATE_SUB_KEYS = &H8
  8. Private Const ERROR_NO_MORE_ITEMS = 259&
  9. Private Const REG_SZ = 1
  10. Private Type FILETIME
  11.         dwLowDateTime As Long
  12.         dwHighDateTime As Long
  13. End Type
  14.  
  15. Function GetInstalledApps() As String()
  16. Dim RetArray() As String
  17. Dim hParentKey As Long
  18. Dim hSubKey As Long
  19. Dim lIndex As Long
  20. Dim sAppID As String
  21. Dim lAppID As Long
  22. Dim sAppName As String
  23. Dim lAppName As Long
  24. Dim ValueType As Long
  25. Dim DummyTime As FILETIME
  26. Dim UbRetArray As Long
  27. Dim QVErr As Long
  28. Dim sErr As String
  29. Dim lErr As Long
  30.  
  31. UbRetArray = -1
  32. If RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Uninstall", 0, KEY_ENUMERATE_SUB_KEYS, hParentKey) = 0 Then
  33.     sAppID = Space(64)
  34.     lAppID = 64
  35.     Do While RegEnumKeyEx(hParentKey, lIndex, sAppID, lAppID, 0, vbNullString, 0, DummyTime) = 0
  36.         sAppID = Left(sAppID, lAppID)
  37.         If RegOpenKeyEx(hParentKey, sAppID, 0, KEY_QUERY_VALUE, hSubKey) = 0 Then
  38.             lAppName = 0
  39.             If RegQueryValueEx(hSubKey, "DisplayName", 0, ValueType, ByVal 0, lAppName) = 0 Then
  40.                 If ValueType = REG_SZ Then
  41.                     sAppName = Space(lAppName)
  42.                     RegQueryValueEx hSubKey, "DisplayName", 0, 0, ByVal sAppName, lAppName
  43.                     sAppName = Left(sAppName, lAppName - 1)
  44.                     UbRetArray = UbRetArray + 1
  45.                     ReDim Preserve RetArray(UbRetArray)
  46.                     RetArray(UbRetArray) = sAppName
  47.                 End If
  48.             End If
  49.             RegCloseKey hSubKey
  50.             hSubKey = 0
  51.         End If
  52.         lIndex = lIndex + 1
  53.         sAppID = Space(64)
  54.         lAppID = 64
  55.     Loop
  56.     RegCloseKey hParentKey
  57. End If
  58. GetInstalledApps = RetArray
  59. End Function

Have fun