コード例 #1
0
        static ProductDetection()
        {
            Logger.Debug("Started " + MethodBase.GetCurrentMethod());
            try
            {
                Logger.Info("Started collection of HP  products information");

                //1. Check for LR Full installation
                //2. Check for PC Host installation
                //3. Check for VuGen SA installation, Analysis SA, Load Generator SA etc...
                Logger.Info("Detecting LoadRunner installation");
                FullLR = new LoadRunnerInfo();
                if (FullLR.IsInstalled)
                {
                    installedProducts.Add(FullLR);
                    isFullLRInstalled = true;
                    Vugen             = FullLR;
                    Analysis          = FullLR;
                    Loadgen           = FullLR;
                }
                else //if no LR is installed check for PC Host
                {
                    Logger.Info("Detecting Performance Center Host installation");
                    FullLR = new PerformanceCenterHostInfo();
                    if (FullLR.IsInstalled)
                    {
                        installedProducts.Add(FullLR);
                        isFullLRInstalled = true;
                        isPCHostInstalled = true;
                        Vugen             = FullLR;
                        Analysis          = FullLR;
                        Loadgen           = FullLR;
                    }
                    else //if no LR and PC Host are not installed check for VuGen SA
                    {
                        Logger.Info("Detecting VuGen Stand Alone installation");
                        Vugen = new VugenSAInfo();
                        if (Vugen.IsInstalled)
                        {
                            installedProducts.Add(Vugen);
                        }

                        Logger.Info("Detecting Analysis Stand Alone installation");
                        Analysis = new AnalysisInfo();
                        if (Analysis.IsInstalled)
                        {
                            installedProducts.Add(Analysis);
                        }

                        Logger.Info("Detecting Load Generator installation");
                        Loadgen = new LoadGeneratorInfo();
                        if (Loadgen.IsInstalled)
                        {
                            installedProducts.Add(Loadgen);
                        }

                        Logger.Info("Detecting MI Listener installation");
                        miListener = new MIListener();
                        if (miListener.IsInstalled)
                        {
                            installedProducts.Add(miListener);
                        }
                    }
                }

                Logger.Info("Detecting Monitor Over Firewall installation");
                monitorOverFirewall = new MonitorOverFirewallInfo();
                if (monitorOverFirewall.IsInstalled)
                {
                    installedProducts.Add(monitorOverFirewall);
                }

                Logger.Info("Detecting Performance Center Host installation");
                pcServer = new PerformanceCenterServerInfo();
                if (pcServer.IsInstalled)
                {
                    installedProducts.Add(pcServer);
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
            finally
            {
                Logger.Debug("Ended " + MethodBase.GetCurrentMethod());
            }
        }
コード例 #2
0
ファイル: ProductDetection.cs プロジェクト: harrygg/LRDetect
        static ProductDetection()
        {
            Logger.Debug("Started " + MethodBase.GetCurrentMethod());
              try
              {
            Logger.Info("Started collection of HP  products information");

            //1. Check for LR Full installation
            //2. Check for PC Host installation
            //3. Check for VuGen SA installation, Analysis SA, Load Generator SA etc...
            Logger.Info("Detecting LoadRunner installation");
            FullLR = new LoadRunnerInfo();
            if (FullLR.IsInstalled)
            {
              installedProducts.Add(FullLR);
              isFullLRInstalled = true;
              Vugen = FullLR;
              Analysis = FullLR;
              Loadgen = FullLR;
            }
            else //if no LR is installed check for PC Host
            {
              Logger.Info("Detecting Performance Center Host installation");
              FullLR = new PerformanceCenterHostInfo();
              if (FullLR.IsInstalled)
              {
            installedProducts.Add(FullLR);
            isFullLRInstalled = true;
            isPCHostInstalled = true;
            Vugen = FullLR;
            Analysis = FullLR;
            Loadgen = FullLR;
              }
              else //if no LR and PC Host are not installed check for VuGen SA
              {
            Logger.Info("Detecting VuGen Stand Alone installation");
            Vugen = new VugenSAInfo();
            if (Vugen.IsInstalled)
              installedProducts.Add(Vugen);

            Logger.Info("Detecting Analysis Stand Alone installation");
            Analysis = new AnalysisInfo();
            if (Analysis.IsInstalled)
              installedProducts.Add(Analysis);

            Logger.Info("Detecting Load Generator installation");
            Loadgen = new LoadGeneratorInfo();
            if (Loadgen.IsInstalled)
              installedProducts.Add(Loadgen);

            Logger.Info("Detecting MI Listener installation");
            miListener = new MIListener();
            if (miListener.IsInstalled)
              installedProducts.Add(miListener);
              }
            }

            Logger.Info("Detecting Monitor Over Firewall installation");
            monitorOverFirewall = new MonitorOverFirewallInfo();
            if (monitorOverFirewall.IsInstalled)
              installedProducts.Add(monitorOverFirewall);

            Logger.Info("Detecting Performance Center Host installation");
            pcServer = new PerformanceCenterServerInfo();
            if (pcServer.IsInstalled)
              installedProducts.Add(pcServer);

              }
              catch (Exception ex)
              {
            System.Windows.Forms.MessageBox.Show(ex.ToString());
              }
              finally
              {
            Logger.Debug("Ended " + MethodBase.GetCurrentMethod());
              }
        }