コード例 #1
0
 /// <summary>
 /// Method to get the software product code by its upgrade code
 /// </summary>
 /// <returns></returns>
 public static string GetProductCode(string upgradeCode)
 {
     try
     {
         string value = RegistryWrapper.GetFirstValueName(RegHive.ClassesRoot, @"Installer\UpgradeCodes\" + upgradeCode);
         return(value);
     }
     catch (Exception)
     {
         return(null);
     }
 }
コード例 #2
0
ファイル: ProductInfo.cs プロジェクト: harrygg/LRDetect
 /// <summary>
 /// Method to get the software product code by its upgrade code
 /// </summary>
 /// <returns></returns>
 public static string GetProductCode(string upgradeCode)
 {
     try
     {
         string value = RegistryWrapper.GetFirstValueName(RegHive.ClassesRoot, @"Installer\UpgradeCodes\" + upgradeCode);
         if (Logger.level > 3)
         {
             if (value != null)
             {
                 Logger.Debug("Product code " + value + " matched upgrade code " + upgradeCode);
             }
             else
             {
                 Logger.Debug("No product code " + value + " matched upgrade code " + upgradeCode);
             }
         }
         return(value);
     }
     catch (Exception ex)
     {
         Logger.Warn("Product code not found for the following product upgrade code: " + upgradeCode + "\n" + ex.ToString());
         return(null);
     }
 }