Take the 2-minute tour ×

I am writing a C# application and I need to determine if quicktime is installed on the system and what version. This is on windows.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

A quick Google search turned up the following code from this page:

strComputer = "."


Set colItems = objWMIService.ExecQuery _
    ("Select * From Win32_Product Where Name = 'QuickTime'")

If colItems.Count = 0 Then
    Wscript.Echo "QuickTime is not installed on this computer."
    For Each objItem in colItems
        Wscript.Echo "QuickTime version: " & objItem.Version
End If

"But wait!" you say, "That's VBScript, not C#!" That's true, but it's VBScript that does WMI queries. Another quick Google search turns up how to do WMI queries from C#.

share|improve this answer
Clever, indeed. Even if you don't know VBScript, it's still decent pseudocode for the C# version. –  Robert Harvey Jan 28 '12 at 0:40
thanks, I'll see if I can get this working. –  Zarxrax Jan 28 '12 at 1:16

Try this:

using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
    if (key != null)
        foreach (string subKeyName in key.GetSubKeyNames())
            using (RegistryKey subKey = key.OpenSubKey(subKeyName))
                if (subKey == null) continue;

                var displayName = subKey.GetValue("DisplayName") as string;

                if (displayName == null || !displayName.Equals("QuickTime")) continue;

                var version = subKey.GetValue("DisplayVersion");

share|improve this answer

Your Answer


