public static void BackgroundTask()
        {
            //Here we start new thread to load Components which is too big to load so i loaded it in background.
            //List<Thread> bigThreads = LoadBigItems();
            foreach (Thread th in bigThreads)
            {
                th.Join();
            }

            //Now start another thread to compare the Component key.
            if (Controller.shouldAbort)
            {
                return;
            }

            Thread thComponents = new Thread(new ThreadStart(Analysis.Installer.Add_HKLM_Components));

            thComponents.Start();
            thComponents.Join();

            if (Controller.shouldAbort)
            {
                return;
            }


            GenerateNodeForBigItems();

            Logger.LogMsg("UpdateNodeTextWithNodeCount (BG) started.");
            RegNode.UpdateNodeTextWithNodeCount(Controller.rootNodeBig);
            Logger.LogMsg("UpdateNodeTextWithNodeCount (BG) done.");

            DoneBGCallBack();
        }
        public static void ScanSQLRegistry()
        {
            UpdateProgress("Scan starts...", true);

            // var m=LoadSQLProductFromPreData();
            //  m.name = "SQL2008-2017RTM_AllLang";
            //  m.source = "";
            //  m.SaveData("SQL2008-2017RTM_AllLang", @"c:\temp\SQL2008-SQL2017_AllLang.sum.xml");

            ////  LoadSQLProductFromSetupSrc();


            if (sumSQLProduct != null)
            {
                sumSQLProduct.Reset();
            }

            //  SQLProduct sql = new SQLProduct("SQL2012", @"D:\SETUP Media\2016\2016 SQLFull_ENU");
            // SQLProduct sql = new SQLProduct("SQL2012", @"\\shlabprod01\Products\Applications\Server\SQL\SQL Server 2012\SQLFULL");
            //    string data = OutputProcessor.SerializeToXML<SQLProduct>(sql);

            /*
             * string f = @"c:\temp\SQL2016RTM_ENU.xml";
             * //  File.WriteAllText(f, data);
             * SQLProduct sql0 = new SQLProduct(f);
             * sqlProducts.Add(sql0);
             */

            Thread sourceTD = null;

            if (SQLSetupSource != "")
            {
                sourceTD = new Thread(new ThreadStart(LoadSQLProductFromSetupSrc));
                sourceTD.Start();
            }


            //start thread to load registry keys first.
            regHives.Clear();
            normalThreads = LoadRegHives();

            //and also load big Items
            bigThreads = LoadBigItems();

            //Load pre-processed data;
            sumSQLProduct = LoadSQLProductFromMetaData();

            if (!string.IsNullOrEmpty(cachedMetaDataFile))
            {
                sumSQLProduct.AddProductSumFromFile(cachedMetaDataFile);
            }

            if (sourceTD != null)
            {
                sourceTD.Join();
            }


            //Time to merge it.
            if (sumFromSetupSrc != null)
            {
                sumSQLProduct.AddProductSum(sumFromSetupSrc);
            }

            ////Now need to add products to gProduct
            //foreach (SQLProduct sql in Controller.products)
            //{
            //    sumSQLProduct.InitOrAddHashSet(sql);
            //}
            //Time to get SQL related keys
            sqlRegKeys.Clear();

            //wait for all thread loading is completed.
            foreach (Thread th in normalThreads)
            {
                th.Join();
            }

            //If closing
            if (Controller.shouldAbort)
            {
                return;
            }


            Analysis.KnownKeys.Add();
            Analysis.Installer.Add();

            Analysis.Services.Add();
            Analysis.Uninstall.Add();//need to call after Installer.Add because it will reference data geot from installer.Add function
            Analysis.COMClass.Add();

            Analysis.FromMSI.Add();
            //Now generate nodes for treeview

            Logger.LogMsg("Total found SQL related keys:" + sqlRegKeys.Count);
            GenerateRegNodes();

            Logger.LogMsg("UpdateNodeTextWithNodeCount started.");
            RegNode.UpdateNodeTextWithNodeCount(Controller.rootNode);
            Logger.LogMsg("UpdateNodeTextWithNodeCount done.");


            UpdateProgress("Scan done.", true);
            DoneCallBack();
        }