Example #1
0
 /// <summary>
 /// Look for installed applications with names containing 'Word' and showing their properties (installed location, version, ...)
 /// </summary>
 /// <param name="args"></param>
 static void Main(string[] args)
 {
     foreach (var p in InstalledProduct.Enumerate())
     {
         try
         {
             if (p.InstalledProductName.Contains("Word"))
             {
                 Console.Out.WriteLine("{0}\r\n-------------------------------------------------------------\r\n{1}", p.GUID, p.ToString());
             }
         }
         catch (Exception ex)
         {
             // Some products might throw an exception trying to access InstalledProductName propoerty.
         }
     }
 }
 /// <summary>
 /// Checks to see if Plex Media Server is installed.
 /// </summary>
 /// <returns>
 /// True if it is installed, false if it isn't.
 /// </returns>
 private bool IsInstalled()
 {
     return((InstalledProduct.Enumerate()
             .Where(product => product.DisplayName == DisplayName)).Any());
 }