Esempio n. 1
0
 private static bool IsICAOkInternal()
 {
     try
     {
         using (var ICA = new AxWFICALib.AxICAClient {
             Parent = frmMain.defaultInstance
         })
         {
             ICA.CreateControl();
             ICAVer = ICA.ClientVersion;
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 2
0
 private static bool IsICAOkInternal()
 {
     try
     {
         using (var ICA = new AxWFICALib.AxICAClient { Parent = frmMain.defaultInstance })
         {
             ICA.CreateControl();
             ICAVer = ICA.ClientVersion;
         }
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
        private void CheckComponents()
        {
            string errorMsg = Language.strCcNotInstalledProperly;

            pnlCheck1.Visible = true;
            pnlCheck2.Visible = true;
            pnlCheck3.Visible = true;
            pnlCheck4.Visible = true;
            pnlCheck5.Visible = true;

            AxMSTSCLib.AxMsRdpClient5NotSafeForScripting rdpClient = null;

            try
            {
                rdpClient = new AxMSTSCLib.AxMsRdpClient5NotSafeForScripting();
                rdpClient.CreateControl();

                while (!rdpClient.Created)
                {
                    Thread.Sleep(0);
                    System.Windows.Forms.Application.DoEvents();
                }

                if (!(new Version(Convert.ToString(rdpClient.Version)) >= ProtocolRDP.Versions.RDC80))
                {
                    throw (new Exception(string.Format("Found RDC Client version {0} but version {1} or higher is required.", rdpClient.Version, ProtocolRDP.Versions.RDC80)));
                }

                pbCheck1.Image      = Resources.Good_Symbol;
                lblCheck1.ForeColor = Color.DarkOliveGreen;
                lblCheck1.Text      = "RDP (Remote Desktop) " + Language.strCcCheckSucceeded;
                txtCheck1.Text      = string.Format(Language.strCcRDPOK, rdpClient.Version);
            }
            catch (Exception ex)
            {
                pbCheck1.Image      = Resources.Bad_Symbol;
                lblCheck1.ForeColor = Color.Firebrick;
                lblCheck1.Text      = "RDP (Remote Desktop) " + Language.strCcCheckFailed;
                txtCheck1.Text      = Language.strCcRDPFailed;

                Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "RDP " + errorMsg, true);
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, ex.Message, true);
            }

            if (rdpClient != null)
            {
                rdpClient.Dispose();
            }


            VncSharp.RemoteDesktop VNC = null;

            try
            {
                VNC = new VncSharp.RemoteDesktop();
                VNC.CreateControl();

                while (!VNC.Created)
                {
                    Thread.Sleep(10);
                    System.Windows.Forms.Application.DoEvents();
                }

                pbCheck2.Image      = Resources.Good_Symbol;
                lblCheck2.ForeColor = Color.DarkOliveGreen;
                lblCheck2.Text      = "VNC (Virtual Network Computing) " + Language.strCcCheckSucceeded;
                txtCheck2.Text      = string.Format(Language.strCcVNCOK, VNC.ProductVersion);
            }
            catch (Exception)
            {
                pbCheck2.Image      = Resources.Bad_Symbol;
                lblCheck2.ForeColor = Color.Firebrick;
                lblCheck2.Text      = "VNC (Virtual Network Computing) " + Language.strCcCheckFailed;
                txtCheck2.Text      = Language.strCcVNCFailed;

                Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "VNC " + errorMsg, true);
            }

            if (VNC != null)
            {
                VNC.Dispose();
            }


            string pPath = "";

            if (Settings.Default.UseCustomPuttyPath == false)
            {
                pPath = GeneralAppInfo.HomePath + "\\PuTTYNG.exe";
            }
            else
            {
                pPath = Convert.ToString(Settings.Default.CustomPuttyPath);
            }

            if (File.Exists(pPath))
            {
                pbCheck3.Image      = Resources.Good_Symbol;
                lblCheck3.ForeColor = Color.DarkOliveGreen;
                lblCheck3.Text      = "PuTTY (SSH/Telnet/Rlogin/RAW) " + Language.strCcCheckSucceeded;
                txtCheck3.Text      = Language.strCcPuttyOK;
            }
            else
            {
                pbCheck3.Image      = Resources.Bad_Symbol;
                lblCheck3.ForeColor = Color.Firebrick;
                lblCheck3.Text      = "PuTTY (SSH/Telnet/Rlogin/RAW) " + Language.strCcCheckFailed;
                txtCheck3.Text      = Language.strCcPuttyFailed;

                Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "PuTTY " + errorMsg, true);
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "File " + pPath + " does not exist.", true);
            }


            AxWFICALib.AxICAClient ICA = null;

            try
            {
                ICA        = new AxWFICALib.AxICAClient();
                ICA.Parent = this;
                ICA.CreateControl();

                while (!ICA.Created)
                {
                    Thread.Sleep(10);
                    System.Windows.Forms.Application.DoEvents();
                }

                pbCheck4.Image      = Resources.Good_Symbol;
                lblCheck4.ForeColor = Color.DarkOliveGreen;
                lblCheck4.Text      = "ICA (Citrix ICA) " + Language.strCcCheckSucceeded;
                txtCheck4.Text      = string.Format(Language.strCcICAOK, ICA.Version);
            }
            catch (Exception ex)
            {
                pbCheck4.Image      = Resources.Bad_Symbol;
                lblCheck4.ForeColor = Color.Firebrick;
                lblCheck4.Text      = "ICA (Citrix ICA) " + Language.strCcCheckFailed;
                txtCheck4.Text      = Language.strCcICAFailed;

                Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "ICA " + errorMsg, true);
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, ex.Message, true);
            }

            if (ICA != null)
            {
                ICA.Dispose();
            }


            bool GeckoBad    = false;
            var  GeckoFxPath = Path.Combine(GeneralAppInfo.HomePath, "Firefox");

            if (File.Exists(Path.Combine(GeneralAppInfo.HomePath, "Geckofx-Core.dll")))
            {
                if (Directory.Exists(GeckoFxPath))
                {
                    if (!File.Exists(Path.Combine(GeckoFxPath, "xul.dll")))
                    {
                        GeckoBad = true;
                    }
                }
                else
                {
                    GeckoBad = true;
                }
            }

            if (GeckoBad == false)
            {
                pbCheck5.Image      = Resources.Good_Symbol;
                lblCheck5.ForeColor = Color.DarkOliveGreen;
                lblCheck5.Text      = "Gecko (Firefox) Rendering Engine (HTTP/S) " + Language.strCcCheckSucceeded;
                if (!Xpcom.IsInitialized)
                {
                    Xpcom.Initialize("Firefox");
                }
                txtCheck5.Text = Language.strCcGeckoOK + " Version: " + Xpcom.XulRunnerVersion;
            }
            else
            {
                pbCheck5.Image      = Resources.Bad_Symbol;
                lblCheck5.ForeColor = Color.Firebrick;
                lblCheck5.Text      = "Gecko (Firefox) Rendering Engine (HTTP/S) " + Language.strCcCheckFailed;
                txtCheck5.Text      = Language.strCcGeckoFailed;

                Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "Gecko " + errorMsg, true);
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "GeckoFx was not found in " + GeckoFxPath, true);
            }
        }