Пример #1
0
        /// <summary>
        /// private void showing()
        /// Showing system and installation parameters form
        /// Installation is not possible if one of system parameters is red
        /// For Windows 7 can not define if VT/x is enabled in BIOS
        /// </summary>
        private void showing()
        {
            tbxAppDir.Text     = Inst.subutai_path(); //Show Installation path, defined in installer
            tbxAppDir.Enabled  = false;               //Change of installation type not allowed
            tbxAppDir.ReadOnly = true;
            //Defining system parameters
            hostOSversion      = Environment.OSVersion.Version.ToString();                                                  //OS version (6.1, 6.2, 10)
            hostOSversion_user = SysCheck.OS_name().Replace("Windows", "Win");                                              //OS name in human readable format
            shortVersion       = hostOSversion.Substring(0, 3);
            hostCores          = Environment.ProcessorCount;                                                                //number of logical processors
            host64             = Environment.Is64BitOperatingSystem;                                                        //Processor architecture - x86 or x64
            vboxVersion        = SysCheck.vbox_version();                                                                   //Oracle VirtualBox version
            hostRam            = (ulong)new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory / 1024 / 1024; //RAM in MB
            hostVT             = SysCheck.check_vt();                                                                       //Checking if VT-x is enabled

            //Filling textboxes
            l_Proc.Text = hostCores.ToString();//SysCheck.hostCores.ToString();
            l_RAM.Text  = hostRam.ToString();
            l_S64.Text  = host64.ToString();
            l_OS.Text   = hostOSversion_user;
            l_VT.Text   = hostVT;
            l_VB.Text   = vboxVersion;

            tb_Info.Text = "Subutai can be installed on Windows versions 7, 8, 8.1, 10.";
            // "* This value may need to be checked in BIOS. If installation fails, check if
            //hardware support for virtualization(VT-x/AMD-V) is allowed in BIOS.";
            tb_Info.Text += Environment.NewLine;
            tb_Info.Text += Environment.NewLine;

            tb_Proc_VM.Text = VMs.vm_CPUs().ToString();
            tb_RAM_VM.Text  = VMs.vm_RAM().ToString();

            //Log system info:
            logger.Info("OS: {0}, {1}", hostOSversion, hostOSversion_user);
            logger.Info("CPUs: {0}", hostCores);
            logger.Info("Is 64x: {0}", host64);
            logger.Info("RAM: {0}MB", hostRam);
            logger.Info("VT/x enabled: {0}", hostVT);
            logger.Info("Oracle VBox version: {0}", vboxVersion);
            //Check if can install
            //checking(peerType(getCheckedRadio(gbxTypeInst)));
            string pType = peerType(clbPeerType);

            if (pType != "")
            {
                checking(peerType(clbPeerType));
            }
        }
Пример #2
0
        /// <summary>
        /// checking()
        /// Check if Subutai can be installed - system parameters meet Subutai requirements
        /// If parameter does not system requirements, it will be shown in red
        /// For Windows 7 can not define if VT/x is enabled in BIOS
        /// </summary>
        private void checking(string pType)
        {
            string msg     = "";
            string msg_res = "";

            //2 or more processor cores
            if (hostCores < 2)
            {
                l_Proc.ForeColor = Color.Red;
                tb_Info.Text    += Environment.NewLine;
                tb_Info.Text    += Environment.NewLine;
                tb_Info.Text    += "Subutai needs at least 2 cores!";
                res      = false;
                msg_res += "Number of cores on Your machine should be 2 or more\n";
            }
            else
            {
                l_Proc.ForeColor = Color.Green;
            }

            //RAM > 4000 KB
            //here: change
            if ((long)hostRam < 3800)
            {
                l_RAM.ForeColor = Color.Red;
                tb_Info.Text   += Environment.NewLine;
                tb_Info.Text   += Environment.NewLine;
                tb_Info.Text   += "Subutai needs more than 3000 MB of RAM.";
                res             = false;
                msg_res        += "RAM should be 3800 MB or more\n";
            }
            else
            {
                l_RAM.ForeColor = Color.Green;
            }

            //Processor architecture x64
            if (!host64)
            {
                l_S64.ForeColor = Color.Red;
                tb_Info.Text   += Environment.NewLine;
                tb_Info.Text   += Environment.NewLine;
                tb_Info.Text   += "Subutai needs x64 processor architecture.";
                res             = false;
                res_client      = false; // for now may be later can change
                msg_res        += "Processor architecture should be x64";
            }
            else
            {
                l_S64.ForeColor = Color.Green;
            }

            //VT-x enabled
            if (!hostVT.ToLower().Contains("true"))
            {
                if (shortVersion != "6.1")//not Windows  7
                {
                    l_VT.ForeColor = Color.Red;
                    tb_Info.Text  += Environment.NewLine;
                    tb_Info.Text  += Environment.NewLine;
                    tb_Info.Text  += "Please, enable hardware virtualization support (Vt-X/AMD-V) in BIOS!";
                    res            = false;
                    msg_res       += "Processor virtualisation should be enabled\n";
                }
                else
                {
                    l_VT.ForeColor = Color.DarkBlue;
                }
            }
            else
            {
                l_VT.ForeColor = Color.Green;
            }

            //Oracle Virtual Box version >5.0
            if (!SysCheck.vbox_version_fit(vb_version2fit, l_VB.Text))
            {
                l_VB.ForeColor = Color.Red;
                res            = false;
                msg_res       += "Oracle VirtualBox version should be 5.1.0 or higher";
            }
            else
            {
                l_VB.ForeColor = Color.Green;
            }

            //Checking Windows version >= 6.1, 6.1 is Windows 7
            if (!SysCheck.vbox_version_fit("6.1", shortVersion))
            {
                l_OS.ForeColor = Color.Red;
                res            = false;
                res_client     = false;
                msg_res       += "Windows version should 7 or hegher";
            }
            else
            {
                l_OS.ForeColor = Color.Green;
            }

            //If meet requirements
            if (res)
            {
                btnInstall.Text = $"Install Subutai {Program.inst_type}";
                if (shortVersion != "6.1")
                {
                    //Can install
                    //Win 8, 10
                    lblCheckResult.Text      = "Subutai Social can be installed on Your system. Press Install button";
                    lblCheckResult.ForeColor = Color.Green;

                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += "Please turn off SmartScreen and Antivirus software for installation time.";
                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += "DHCP server must be running on the local network.";
                }
                else
                {
                    //Windows 7
                    if (pType != "DC,")
                    {
                        lblCheckResult.Text      = "Impossible to check if VT-x is enabled.";
                        lblCheckResult.ForeColor = Color.Blue;
                        l_VT.ForeColor           = Color.DarkBlue;
                        tb_Info.Text             = $"Can not define if VT-x is enabled. \nPlease find in {tbxAppDir.Text}bin and run (As Administrator) Microsoft Hardware-assisted virtualization (HAV) DETECTION TOOL: havdetectiontool.exe";
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += "If VT-x is not enabled, close form, cancel installation and enable in BIOS.";
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += "If VT-x enabled, please turn off Antivirus software for installation time!";
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += "DHCP server must be running on the local network.";
                    }
                    else
                    {
                        lblCheckResult.Text      = "Impossible to check if VT-x is enabled, but Client-Only version can be installed.";
                        lblCheckResult.ForeColor = Color.Green;
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += "Please turn off SmartScreen and Antivirus software for installation time.";
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += Environment.NewLine;
                        tb_Info.Text            += "DHCP server must be running on the local network.";
                    }
                }
                tb_Info.Text += Environment.NewLine;
                tb_Info.Text += Environment.NewLine;
            }
            else //res = false
            {
                if (!res_client) //can not install at all
                {
                    btnInstall.Text          = "Exit";
                    lblCheckResult.Text      = "Sorry, Subutai Social can not be installed. ";
                    lblCheckResult.Text     += "Close form to cancel installation";
                    lblCheckResult.ForeColor = Color.Red;
                    tb_Info.Text             = "Please check Subutai system requirements.";
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += $"Subutai needs Oracle VirtualBox version {vb_version2fit} or higher. Please update or uninstall old version and restart Windows!";
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += "Close form to exit.";
                }
                else if (pType != "DC,")
                {
                    tb_Proc_VM.Enabled = false;
                    tb_RAM_VM.Enabled  = false;

                    btnInstall.Text          = "Exit";
                    msg                      = string.Format("Sorry, Subutai Social can not be installed on Your machine but \nYou still can try out Client Only version!");
                    lblCheckResult.Text      = msg;
                    lblCheckResult.ForeColor = Color.DarkBlue;
                    tb_Info.Text             = "Please check Subutai system requirements.";
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += $"Subutai needs Oracle VirtualBox version {vb_version2fit} or higher. Please update or uninstall old version and restart Windows!";
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += Environment.NewLine;
                    tb_Info.Text            += "You still can install Client-Only version to work with our product.";

                    rbTrial.Enabled  = false;
                    rbRHonly.Enabled = false;

                    msg = string.Format("Sorry, Subutai Social cannot be installed on your machine but You still can try out Client Only version. \n\n{0}\n\nDo you want to install Client Only version ?",
                                        msg_res);
                    DialogResult drs = MessageBox.Show(msg, "Client Only Installation",
                                                       MessageBoxButtons.YesNo,
                                                       MessageBoxIcon.Question,
                                                       MessageBoxDefaultButton.Button1);

                    if (drs == DialogResult.Yes)
                    {
                        rbClientOnly.Checked = true;
                    }
                    else
                    {
                        btnInstall.Text = "Exit";
                    }
                }
                else //client-only
                {
                    btnInstall.Text          = "Install Client Only";
                    msg                      = string.Format("Subutai Social Client Only can be installed on Your system. \nPress Install button to proceed");
                    lblCheckResult.Text      = msg;
                    lblCheckResult.ForeColor = Color.Green;

                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += "Please turn off SmartScreen and Antivirus software for installation time.";
                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += Environment.NewLine;
                    tb_Info.Text += "DHCP server must be running on the local network.";
                }
            }
        }