Example #1
0
        public static void MsiMspScan(string path, string outputFileName)
        {
            Logger.SetupLog();
            Controller.Init(Output, null, null);

            Output("Scanning MSI/MSP packages from:" + path);
            //   SQLProduct sql2016 = new SQLProduct("SQL2016", SQLSetupSource);
            //  sqlProducts.Add(sql2016);

            SQLProduct sql = new SQLProduct(outputFileName, path);


            try
            {
                //string content = OutputProcessor.SerializeToXML<SQLProduct>(sql);
                //File.WriteAllText(outputFileName, content);

                string        name            = "SQLMsiMsp_Scan_" + System.DateTime.Now.ToString("_yyyy-MM-dd_HH_mm_ss");
                SQLProductSum sumFromSetupSrc = new SQLProductSum(name, path, "By SQLMsiMspScan.");
                sumFromSetupSrc.InitOrAddHashSet(sql);
                string file    = Path.GetFileNameWithoutExtension(outputFileName).Replace(".sum", "") + ".sum.xml";
                string content = OutputProcessor.DataContractSerializeToXML <SQLProductSum>(sumFromSetupSrc);
                File.WriteAllText(file, content);
            }
            catch (Exception ex)
            {
                Output(ex.Message);
                Logger.LogError(ex.Message);
            }
        }
Example #2
0
        /// <summary>
        /// the main function, to analzye whether registry key is SQL server related or not.
        /// </summary>
        ///
        public static void Add()
        {
            foundCompressedProductCodes.Clear();
            foundCompressedUpradeCodes.Clear();
            foundCompressedPatchCode.Clear();

            //reassign if customer click scan again.
            sumSQLProduct = Controller.sumSQLProduct;

            int cnt = 0;

            cnt = cnt + Add_HKCR_Products();
            cnt = cnt + Add_HKLM_Products();
            //need to called after Products because Products will get patch code
            cnt = cnt + Add_HKCR_Patches();
            cnt = cnt + Add_HKLM_Patches();
            cnt = cnt + Add_HKCR_UpgradeCodes();
            cnt = cnt + Add_HKLM_UpgradeCodes();
            //   cnt = cnt + Add_HKLM_Components();
            cnt = cnt + Add_HKCR_Dependencies();
            cnt = cnt + Add_HKCR_Features();

            Controller.UpdateProgress("Installer Add keys:" + cnt, true);
        } //Add