/// <summary>
        /// Check if Agent is installed as process. If it is it should be in the Windows Start up folder.
        /// To do that we query the start up programs for the specific captions
        /// </summary>
        ///param name="agentProcessCaption" = either loadrunner or pc agent.
        /// <returns>Returns true or false</returns>
        bool IsAgentProcessInstalled(string agentProcessCaption)
        {
            Logger.Debug("Starting IsAgentProcessInstalled");

            try
            {
                string value = RegistryWrapper.GetValue(RegHive.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", lrAgentProcessCaption);
                if (value != null)
                {
                    installedAgentName = agentProcessCaption;
                    return(true);
                }
                else
                {
                    var queryObj = Helper.GetWMIObject("root\\CIMV2", "Win32_StartupCommand", "WHERE (Caption LIKE '%Agent Process%' OR Caption LIKE '%magent%')");
                    if (queryObj != null)
                    {
                        Logger.Info("Query for Agent installation: Agent caption: " + queryObj["Caption"] + ", command: " + queryObj["Command"]);
                        installedAgentName = agentProcessCaption;
                        return(true);
                    }
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(false);
            }
            finally
            {
                Logger.Debug("Ended IsAgentProcessInstalled");
            }
        }
Example #2
0
        public static string GetROPortMapping()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.br + Html.B("Network > Port Mapping") + Html.br);
            try
            {
                string protocolsKey = @"Software\Mercury Interactive\LoadRunner\Protocols\";
                string sockets      = RegistryWrapper.GetValue(RegHive.CurrentUser, protocolsKey + @"WPlus\Analyzer", "EnableSocketLevelTrappingForWeb", "1");
                string wininet      = RegistryWrapper.GetValue(RegHive.CurrentUser, protocolsKey + @"HTTP\Analyzer", "EnableWinINetTrapForWeb", "0");

                string captureLevel = "Socket level data";
                if (sockets == "1" && wininet == "1")
                {
                    captureLevel = "Socket level and WinINet level data";
                }
                else if (wininet == "1")
                {
                    captureLevel = "WinINet level data";
                }

                output.Append(Html.IndentWithSpaces() + "Capture level: " + captureLevel + Html.br);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
Example #3
0
        /// <summary>
        /// Method to get a HTML formated list of all patches installed for current product
        /// </summary>
        /// <returns> HTML formated string with all patches installed <returns>
        /// <seealso cref="getPatchesCodes()">
        /// See also the getPatchesCodes method </seealso>
        private string GetPatchesInstalled()
        {
            try
            {
                //Stopwatch stopWatch = Stopwatch.StartNew();
                List <string> patchesCodes     = GetPatchesCodes();
                StringBuilder patchesInstalled = new StringBuilder();

                if (patchesCodes != null)
                {
                    foreach (string patchCode in patchesCodes)
                    {
                        //TODO this check might be unnecessarry
                        if (patchCode != "Patches")
                        {
                            string keyPath       = MSIPatchesRegPath + patchCode;
                            string dateInstalled = Helper.ConvertInstallDate(RegistryWrapper.GetValue(RegHive.LocalMachine, keyPath, "Installed"));
                            string displayName   = RegistryWrapper.GetValue(RegHive.LocalMachine, keyPath, "DisplayName");

                            patchesInstalled.Append(Html.B(displayName) + " " + dateInstalled + Html.br);
                        }
                    }
                    return(patchesInstalled.ToString());
                }
                return(null);
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(null);
            }
        }
Example #4
0
        /// <summary>
        /// Method to get the installation date for the current product
        /// </summary>
        /// <returns>String date<returns>
        private string GetInstallDate()
        {
            //string registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + this.ProductCode + @"\InstallProperties";
            string installDate = RegistryWrapper.GetValue(RegHive.LocalMachine, MSIInstallPropertiesRegPath, "InstallDate");

            return(installDate);
        }
Example #5
0
        public static string GetIEExtensions()
        {
            try
            {
                //HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Approved Extensions
                string      keyPath = @"Software\Microsoft\Internet Explorer\Approved Extensions";
                RegistryKey regKey  = Registry.CurrentUser;
                regKey = regKey.OpenSubKey(keyPath);
                String[]      subkeyNames = regKey.GetValueNames();
                StringBuilder output      = new StringBuilder();
                foreach (string subKeyName in subkeyNames)
                {
                    //HKEY_CLASSES_ROOT\Wow6432Node\CLSID\
                    string extName = RegistryWrapper.GetValue(RegHive.ClassesRoot, @"\CLSID\" + subKeyName, null);
                    if (extName != null)
                    {
                        output.Append(extName + Html.br);
                    }

                    extName = RegistryWrapper.GetValue(RegHive.ClassesRoot, @"\CLSID\" + subKeyName + "\\InprocServer32", null);
                    if (extName != null)
                    {
                        output.Append("&nbsp;&nbsp;&nbsp;&nbsp;" + extName + Html.br);
                    }
                }
                return(output.ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(Html.ErrorMsg());
            }
        }
Example #6
0
        /// <summary>
        /// SAPGUI DETECTION
        /// </summary>
        /// <returns></returns>
        public static string GetSapGuiClientInfo()
        {
            string output = "Not detected";

            try
            {
                string SAPsysdir = RegistryWrapper.GetValue(RegHive.LocalMachine, sapguiKeyPath, "SAPsysdir");
                if (SAPsysdir != null)
                {
                    string saplogonexe = Path.Combine(SAPsysdir, "saplogon.exe");

                    FileVersionInfo fvi;
                    if (File.Exists(saplogonexe))
                    {
                        fvi    = FileVersionInfo.GetVersionInfo(Path.Combine(SAPsysdir, "saplogon.exe"));
                        output = "Yes, version " + fvi.FileVersion;
                    }
                }
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }
            return(output);
        }
Example #7
0
        /// <summary>
        /// Method to return the product version from Windows Add Remove Programs
        /// </summary>
        /// <returns></returns>
        public string GetProductVersionFromInstaller()
        {
            Logger.Info("Search for DisplayVersion key in registry " + MSIInstallPropertiesRegPath);
            string displayVersion = RegistryWrapper.GetValue(RegHive.LocalMachine, MSIInstallPropertiesRegPath, "DisplayVersion");

            Logger.Info(MSIInstallPropertiesRegPath + @"\DisplayVersion: " + displayVersion);
            return((displayVersion != null && displayVersion != "") ? displayVersion : Html.ErrorMsg());
        }
Example #8
0
        /// <summary>
        /// Method to get the product version
        /// </summary>
        /// <returns>Product version<returns>
        private string GetProductVersion()
        {
            try
            {
                //example HKLM\SOFTWARE\Mercury Interactive\LoadRunner\CurrentVersion
                string path = this.ProductRegistryPath + "CurrentVersion";
                Logger.Info("Starting product version detection");
                Logger.Info("Registry path to search: " + path);
                string major = RegistryWrapper.GetValue(RegHive.LocalMachine, path, "Major");
                Logger.Info(path + @"\Major: " + major);
                string minor = RegistryWrapper.GetValue(RegHive.LocalMachine, path, "Minor", "00");
                Logger.Info(path + @"\Minor: " + minor);

                //if the version is not found in \Mercury Interactive\LoadRunner\CurrentVersion
                //get it from the Add Remove Programs
                if (major == null || major == "")
                {
                    string versionFromInstaller = GetProductVersionFromInstaller();
                    if (versionFromInstaller != null && versionFromInstaller != "")
                    {
                        // major would be something like 11.04.000 || 11.50.123
                        if (versionFromInstaller.Contains('.'))
                        {
                            string[] parts = versionFromInstaller.Split('.');
                            major = parts[0];
                            minor = parts[1];
                        }
                        else
                        {
                            major = versionFromInstaller;
                        }
                    }
                    else
                    {
                        Logger.Error("Major version not detected!");
                        version = null;
                        return(Html.Error("Version NOT detected"));
                    }
                }
                // Set the version
                version = new Version(Convert.ToInt32(major), Convert.ToInt32(minor));
                // Return the version key
                return(major + "." + minor);
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(null);
            }
        }
Example #9
0
        public static string GetROPortMappingOptions()
        {
            StringBuilder output  = new StringBuilder();
            string        keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\WPlus\SSL";

            output.Append(Html.br + Html.B("Network > Port Mapping > Options") + Html.br);
            output.Append(Html.IndentWithSpaces() + "Record-time auto SSL detection and configuration:" + Html.br);

            try
            {
                string EnableAutoSslDetect = CreateCheckBoxFromValue("Enable auto SSL detection", keyPath, "EnableAutoSslDetect");

                string DefaultSSLVersion = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "DefaultSSLVersion", "23");
                string DefaultSSLCiphers = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "DefaultSSLCiphers", "(Default OpenSsl Ciphers)");

                output.Append(Html.IndentWithSpaces(8) + "SSL Version: " + sslVersions[DefaultSSLVersion] + Html.br);
                output.Append(Html.IndentWithSpaces(8) + "SSL Ciphers: " + DefaultSSLCiphers + Html.br);

                keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\SOCKET";
                output.Append(Html.IndentWithSpaces() + "Record-time auto socket detection:" + Html.br);
                output.Append(CreateCheckBoxFromValue("Enable auto-detection of SOCKET based communication", keyPath, "EnableSocketAutoDetect", "1") + Html.br);

                string SendRecvTransitionThreshold = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "SendRecvTransitionThreshold", "4");
                string SendRecvBufferSizeThreshold = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "SendRecvBufferSizeThreshold", "2048");

                output.Append(Html.IndentWithSpaces(8) + "Send-Receive transition threshold: " + SendRecvTransitionThreshold + Html.br);
                output.Append(Html.IndentWithSpaces(8) + "Send-Receive buffer size threshold: " + SendRecvBufferSizeThreshold + Html.br);

                keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\WPlus\Analyzer";
                string WSPDebuggingLevelKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "WSPDebuggingLevel", "0");
                var    debuggingLevel       = new Hashtable()
                {
                    { "0", "None" }, { "5", "Standard (Default)" }, { "6", "Debug" }, { "9", "Advanced Debug" }
                };

                output.Append(Html.br + Html.IndentWithSpaces() + "Log level: " + debuggingLevel[WSPDebuggingLevelKey] + Html.br);
                return(output.ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(ex.Message);
            }
        }
Example #10
0
        public static string GetROScriptLevel()
        {
            StringBuilder output  = new StringBuilder();
            string        keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording";

            output.Append(Html.br + Html.B("General > Recording") + Html.br);
            output.Append(Html.IndentWithSpaces() + "HTTP/HTML Level" + Html.br);

            try
            {
                String AnalogMode          = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Analog Mode", "0");
                String RecordDILFlag       = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "RecordDILFlag", "0");
                String RecordOutOfContext  = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Record OutOfContext", "2");
                String ConcurrentGroupFlag = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "ConcurrentGroupFlag", "1");

                //check if we use HTML mode
                output.Append(Html.IndentWithSpaces() + Html.Radio((AnalogMode == "0"), 0) + "HTML-based script" + Html.br);

                if (AnalogMode == "0")
                {
                    output.Append(Html.IndentWithSpaces() + "Script type: " + Html.br);
                    output.Append(Html.Radio(RecordDILFlag == "0", 8) + "A script describing user actions (e.g. web_link, web_submit_form)" + Html.br);
                    output.Append(Html.Radio(RecordDILFlag == "1", 8) + "A script containing explicit URLs only (e.g. web_url, web_submit_data)" + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Non HTML-generated elements (e.g. JavaScript, VBScript, ActiveX, Applets)" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "2", 8) + "Record within the current script step" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "1", 8) + "Do not record" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "0", 8) + "Record within the current script step" + Html.br);
                }

                output.Append(Html.Radio(Convert.ToInt16(AnalogMode) > 0) + "URL-based script" + Html.br);
                if (Convert.ToInt16(AnalogMode) > 0)
                {
                    output.Append(Html.CheckBox(ConcurrentGroupFlag == "1") + "Record within the current script step" + Html.br);
                    //If AnalogMode is 3 then the option is checked, if it is 2 it is unchecked
                    output.Append(Html.CheckBox(AnalogMode == "3") + "Use web_custom_request only" + Html.br);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
Example #11
0
        public static string GetRODataFormat()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.B("Data Format Extention") + Html.br);

            try
            {
                string keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\GlobalDfe\Recording\DFE";
                output.Append(CreateCheckBoxFromValue("Enable data format extention", keyPath, "Enabled", "False") + Html.br);
                output.Append(CreateCheckBoxFromValue("Verify formatted data", keyPath, "VerifyFormatedData", "False") + Html.br);
                string whatToFormat = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "WhatToFormat", "1");
                whatToFormat = whatToFormat == "1" ? "Code and snapshots" : "Snapshots";
                output.Append(Html.IndentWithSpaces() + "Format: " + whatToFormat + Html.br);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
Example #12
0
        internal static string GetJenkinsPluginInfo()
        {
            var pluginFile = "";

            try
            {
                var executable = RegistryWrapper.GetValue(RegHive.LocalMachine, @"SYSTEM\CurrentControlSet\Services\Jenkins", "ImagePath");
                if (executable != null)
                {
                    var path = Path.GetDirectoryName(executable.Replace("\"", ""));
                    pluginFile = Path.Combine(path, @"plugins\hp-application-automation-tools-plugin.jpi");
                }
                //ServiceController sc = new ServiceController("Jenkins");
                //output.Append("Status: " + sc.Status);
                return("HP Application Automation Tools plugin is " + (File.Exists(pluginFile) ? "" : "not ") + "installed");
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(Html.ErrorMsg());
            }
        }
Example #13
0
        /// <summary>
        /// Method to get the product name
        /// </summary>
        /// <returns>Product name<returns>
        private string GetProductName()
        {
            string displayName = RegistryWrapper.GetValue(RegHive.LocalMachine, MSIInstallPropertiesRegPath, "DisplayName");

            return((displayName != null) ? Html.B(displayName) : null);
        }
Example #14
0
        /// <summary>
        /// Method to get the product directory where the product is installed
        /// </summary>
        /// <returns></returns>
        private string GetInstallLocation()
        {
            string installLocation = RegistryWrapper.GetValue(RegHive.LocalMachine, MSIInstallPropertiesRegPath, "InstallLocation");

            return(installLocation);
        }
Example #15
0
        public static string GetROHttpProperties()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.B("HTTP Properties > Advanced") + Html.br);

            try
            {
                string keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording";

                output.Append(CreateCheckBoxFromValue("Reset context for each action", keyPath, "ResetContextBetweenActions") + Html.br);
                output.Append(CreateCheckBoxFromValue("Save snapshots locally", keyPath, "SaveSnapshotResources") + Html.br);
                output.Append(CreateCheckBoxFromValue("Generate web_reg_find functions for page titles", keyPath, "RecordWebRegFind") + Html.br);
                output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Generate web_reg_find functions for sub-frames", keyPath, "RecordWebRegFindNonPrimary") + Html.br);
                output.Append(CreateCheckBoxFromValue("Add comment to script for HTTP errors while recording", keyPath, "AddCommentsIfResponceBiggerThen400") + Html.br);
                output.Append((Html.IndentWithSpaces() + "Support charset") + Html.br);
                output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Support charset UTF-8", keyPath, "Utf8Support") + Html.br);
                output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Support charset EUC-JP", keyPath, "EUC Encode") + Html.br);
                //on LR < 11.5 this doesn't exist
                string ParameterizeServerNames = RegistryWrapper.GetRegKey32(RegHive.CurrentUser, @"Software\Mercury Interactive\Networking\Multi Settings\GlobalParameterizeServer\Recording", "ParameterizeServerNames");
                if (ParameterizeServerNames != null)
                {
                    output.Append(CreateCheckBoxFromValue("Parameterize server names", @"Software\Mercury Interactive\Networking\Multi Settings\GlobalParameterizeServer\Recording", "ParameterizeServerNames") + Html.br);
                }

                String file          = Path.Combine(ProductDetection.Vugen.ConfigFolder, "vugen.ini");
                String settingEngine = Html.ErrorMsg();

                if (File.Exists(file))
                {
                    IniParser vugenIni = new IniParser(file);
                    //Pre 12 versions:
                    if (ProductDetection.Vugen.version < new Version(12, 00))
                    {
                        string oldRecEngine = vugenIni.GetSetting("WebRecorder", "EnableOldSingleRecorded");
                        settingEngine = Html.CheckBox(oldRecEngine == "1") + "Record using earlier recording engine";

                        output.Append(Html.br + (Html.IndentWithSpaces() + "Recording engine: " + Html.br + Html.IndentWithSpaces() + settingEngine + Html.br));
                    }
                    else
                    {
                        string UseProxyRecorder  = vugenIni.GetSetting("WebRecorder", "UseProxyRecorder");
                        string ProxyInStreamMode = vugenIni.GetSetting("WebRecorder", "ProxyInStreamMode");

                        output.Append(Html.br + Html.IndentWithSpaces(4) + "Proxy Recording settings:" + Html.br);

                        output.Append(Html.CheckBox(UseProxyRecorder == "1", false, 8) + "Use the LoadRunner Proxy to record a local application" + Html.br);
                        output.Append(Html.CheckBox(ProxyInStreamMode == "1", false, 8) + "Use streaming mode when recording with the LoadRunner Proxy" + Html.br);
                    }
                }
                output.Append(Html.br + Html.IndentWithSpaces(4) + "Recording schemes: " + Html.br);
                string CustomHeadersKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "CustomHeaderFlag", "2");
                string headersMessage   = "Record headers <b>not</b> in the list";

                if (CustomHeadersKey == "1")
                {
                    headersMessage = "Record headers in the list";
                }
                else if (CustomHeadersKey == "0")
                {
                    headersMessage = "Do not record headers";
                }
                output.Append(Html.IndentWithSpaces(8) + "Headers: " + headersMessage + Html.br);

                if (CustomHeadersKey != "0")
                {
                    string headersKey = CustomHeadersKey == "2" ? "CustomHeadersExclude" : "CustomHeaders";
                    string headers    = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, headersKey, "");
                    var    parts      = Regex.Split(headers, @"(?<=[01])").ToList();
                    parts.RemoveAll(item => item.EndsWith("0") || item.Equals(""));
                    output.Append(Html.IndentWithSpaces(12) + String.Join(Html.IndentWithSpaces(8), parts.ToArray()).Replace("\n1", Html.br).Replace("\n", Html.IndentWithSpaces(2)));
                }

                string ContentTypeFilterKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "ContentTypeFilterFlag", "0");
                var    contentMessage       = new Hashtable()
                {
                    { "0", "Do not filter content types" }, { "1", "Exclude content types in list:" }, { "2", "Exclude content types <b>not</b> in list:" }
                };
                output.Append(Html.br + Html.IndentWithSpaces(8) + "Content types: " + contentMessage[ContentTypeFilterKey] + Html.br);

                if (ContentTypeFilterKey != "0")
                {
                    string filtersKey = ContentTypeFilterKey == "2" ? "ContentTypeFilterExclude" : "ContentTypeFilter";
                    string content    = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, filtersKey, "");

                    var parts = Regex.Split(content, @"(?<=[01])").ToList();
                    parts.RemoveAll(item => item.EndsWith("0") || item.Equals(""));
                    output.Append(Html.IndentWithSpaces(12) + String.Join(Html.IndentWithSpaces(8), parts.ToArray()).Replace("\n1", Html.br).Replace("\n", Html.IndentWithSpaces(2)));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(output + ex.Message);
            }
            return(output.ToString());
        }
Example #16
0
        /*
         * /// <summary>
         * /// Check if certain .net version is installed
         * /// </summary>
         * /// <param name="version">v3.5 | v4.0</param>
         * /// <returns></returns>
         * public bool IsDotNetVersionInstalled(string version)
         * {
         *  try
         *  {
         *      string path = (version == "v4") ? @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" : @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" + version;
         *      string key = Registry.LocalMachine.OpenSubKey(path).GetValue("Install").ToString();
         *      return key == "1" ? true : false;
         *  }
         *  catch (Exception ex)
         *  {
         *      Logger.Error(ex.ToString());
         *      return false;
         *  }
         *
         * }*/

        #endregion

        #region SiteScope detection
        /// <summary>
        /// SiteScope DETECTION
        /// </summary>
        /// <returns></returns>
        public static string GetSiteScopeInfo()
        {
            try
            {
                Logger.Debug("GetSiteScopeInfo() started.");
                // check for installations of
                String[] siteScopeUpgradeCodes = new String[]
                {
                    "7C9790C8356D6A142B1E73F0AE4F22AB", //HP SiteScope for LoadTesting
                    "55D444412FEC9B349A920326911A26F1", //HP SiteScope Integrations
                    "F60D57E75AF65A84E888D007E2799EE9", //HP SiteScope Monitoring
                    "350F46B85A30F7240911CD2A1C293400", //HP SiteScope Server
                    "54509F95E83F79C43A15FDAFB2FF3CA3", //HP SiteScope User Interface
                    "CFCBC45A6F7CE934286FF54746AF7708"  //HP SiteScope Tools
                };

                // Get product codes for installed SiteScope features
                StringBuilder productInfo = new StringBuilder(1024);
                String        productCode = String.Empty;

                Stopwatch stopWatch = Stopwatch.StartNew();

                //if Parallel execution is enabled (default)
                if (FormArguments.async)
                {
                    Helper.EachParallel(siteScopeUpgradeCodes, upgradeCode =>
                    {
                        //foreach (string upgradeCode in siteScopeUpgradeCodes)
                        //{
                        productCode = ProductInfo.GetProductCode(upgradeCode);
                        if (productCode != null)
                        {
                            string registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCode + @"\InstallProperties";
                            //Logger.Log("Searching for SiteScope in registry path " + registryPath);
                            string productName = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "DisplayName");
                            Logger.Info("SiteScope product name " + productName);
                            // Product name found now find the product version
                            string productVersion = String.Empty;
                            if (productName != null)
                            {
                                productVersion = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "DisplayVersion");
                            }

                            string intallDate = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "InstallDate");
                            productInfo.Append(productName + ", version " + productVersion + " " + Helper.ConvertInstallDate(intallDate) + Html.br);
                        }
                    });
                }
                else
                {
                    foreach (string upgradeCode in siteScopeUpgradeCodes)
                    {
                        productCode = ProductInfo.GetProductCode(upgradeCode);
                        if (productCode != null)
                        {
                            string registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCode + @"\InstallProperties";
                            //Helper.Log("Searching for SiteScope in registry path " + registryPath);
                            string productName = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "DisplayName");
                            Logger.Info("SiteScope product name " + productName);
                            // Product name found now find the product version
                            string productVersion = String.Empty;
                            if (productName != null)
                            {
                                productVersion = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "DisplayVersion");
                            }

                            string intallDate = RegistryWrapper.GetValue(RegHive.LocalMachine, registryPath, "InstallDate");
                            productInfo.Append(productName + ", version " + productVersion + " " + Helper.ConvertInstallDate(intallDate) + Html.br);
                        }
                    }
                }

                TimeSpan ts = stopWatch.Elapsed;
                stopWatch.Stop();
                Logger.Debug("DetectOtherSoftware.GetProductCode finished. Execution time: " + ts.ToString());
                Debug.WriteLine(ts.ToString());

                return((productInfo.Length != 0) ? productInfo.ToString() : "No");
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(Html.ErrorMsg());
            }
        }