Example #1
0
        private void bInstall_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Atention!", "Install Remote Control Software in computer", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            Splash splash = new Splash("Installing Remote Control software...");

            splash.Show();
            splash.Invalidate();
            Application.DoEvents();
            if (CheckCommands.CopyPackages("c:\\drivers\\", "vnc_install.exe,data1.zip", _force: false))
            {
                if (CheckCommands.InstallPackage("vnc_install.exe", "/verysilent /norestart"))
                {
                    if (CheckCommands.CopyPackages("c:\\drivers\\", "data1.zip", _force: true))
                    {
                        if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uvnc bvba\\UltraVNC\\ultravnc.ini"))
                        {
                            File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uvnc bvba\\UltraVNC\\ultravnc.ini");
                        }
                        File.Copy("c:\\drivers\\data1.zip", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uvnc bvba\\UltraVNC\\ultravnc.ini");
                    }
                    MessageBox.Show("Remote Control software installed");
                    if (CheckCommands.Check_VNC() == null)
                    {
                        bVNC.Enabled     = false;
                        bVNC_OFF.Enabled = false;
                    }
                }
                else
                {
                    splash.Hide();
                    MessageBox.Show("Error installing Remote Control software");
                }
            }
            else
            {
                splash.Hide();
                MessageBox.Show("Error installing Remote Control software");
            }
            splash.Hide();
            splash.Dispose();
        }