Пример #1
0
        public void InstallTools_RegUnregDLL()
        {
#if FALSE
            // Hardcoded tests for dynamically registering and unregistering
            // a DLL.

            InstallTools.RegisterDLL(@"C:\Program Files\NCT\AudioStudio2\Redist\NCTAudioFile2.dll");
            InstallTools.UnregisterDLL(@"C:\Program Files\NCT\AudioStudio2\Redist\NCTAudioFile2.dll");
            InstallTools.RegisterDLL(@"C:\Program Files\NCT\AudioStudio2\Redist\NCTAudioFile2.dll");
#else
            Assert.Inconclusive("Test Disabled");
#endif
        }
Пример #2
0
        /// <summary>
        /// Constructs an AppInstaller instance.
        /// </summary>
        public AppInstaller()
        {
            InitializeComponent();
            Helper.Init(Assembly.GetExecutingAssembly());

            installFolder = Helper.GetAssemblyFolder(Assembly.GetExecutingAssembly());

            //-----------------------------------------------------------------
            // Add a LillTek InstallTools installer instance.

            installTools = new InstallTools(Const.ConfigServiceName + " Setup", installFolder, "ConfigServiceInstall.ini");
            this.Installers.Add(installTools);

            //-----------------------------------------------------------------
            // Add the Windows Service Installer

            this.serviceInstaller        = new ServiceInstaller();
            this.serviceProcessInstaller = new ServiceProcessInstaller();

            this.serviceInstaller.DisplayName      = Const.ConfigServiceName;
            this.serviceInstaller.ServiceName      = Const.ConfigServiceName;
            this.serviceInstaller.StartType        = ServiceStartMode.Automatic;
            this.serviceInstaller.DelayedAutoStart = true;

            this.serviceProcessInstaller.Account  = ServiceAccount.LocalSystem;
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;

            this.Installers.AddRange(new System.Configuration.Install.Installer[]
            {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });

            //-----------------------------------------------------------------
            // Do some work that the service installer is too stupid to do.

            // Start the service after setup terminates.

            installTools.StartService(Const.ConfigServiceName);

            // Add the service description to the registry.

            installTools.AddRegValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\" + Const.ConfigServiceName + @":Description",
                                     "Implements the global datacenter configuration service.");

            //-----------------------------------------------------------------
            // Build up the set of performance counters to be installed.

            // $todo(jeff.lill): Configure performance counters.
        }
Пример #3
0
        /// <summary>
        /// Attempts to install tools on the vm
        /// </summary>
        /// <param name="vm"></param>
        /// <returns>null if user cancels or an AsyncAction. This is either the InstallPVToolsAction or the CreateCdDriveAction if the VM needed a DVD drive.</returns>
        private void SingleVMExecute(VM vm)
        {
            if (vm.FindVMCDROM() == null)
            {
                DialogResult dialogResult;
                using (var dlg = new NoIconDialog(Messages.NEW_DVD_DRIVE_REQUIRED,
                                                  ThreeButtonDialog.ButtonYes,
                                                  ThreeButtonDialog.ButtonNo))
                {
                    dialogResult = dlg.ShowDialog(Parent);
                }
                if (dialogResult == DialogResult.Yes)
                {
                    //do not register the event ShowUserInstruction; we show explicitly a message afterwards
                    var createDriveAction = new CreateCdDriveAction(vm);

                    using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
                        dlg.ShowDialog(Parent);

                    if (createDriveAction.Succeeded)
                    {
                        ShowMustRebootBox();
                    }

                    InstallTools?.Invoke(createDriveAction);
                }
                return;
            }

            using (var dlg = new WarningDialog(Messages.XS_TOOLS_MESSAGE_ONE_VM,
                                               new ThreeButtonDialog.TBDButton(Messages.INSTALL_XENSERVER_TOOLS_BUTTON,
                                                                               DialogResult.OK, ThreeButtonDialog.ButtonType.ACCEPT, true),
                                               ThreeButtonDialog.ButtonCancel)
            {
                ShowLinkLabel = true,
                LinkText = Messages.INSTALLTOOLS_READ_MORE,
                LinkAction = () => Help.HelpManager.Launch("InstallToolsWarningDialog")
            })
                if (dlg.ShowDialog(Parent) == DialogResult.OK && CheckToolSrs(vm))
                {
                    var installToolsAction = new InstallPVToolsAction(vm, Properties.Settings.Default.ShowHiddenVMs);
                    installToolsAction.Completed += InstallToolsActionCompleted;

                    installToolsAction.RunAsync();
                    InstallTools?.Invoke(installToolsAction);
                }
        }
Пример #4
0
        /// <summary>
        /// Constructs an AppInstaller instance.
        /// </summary>
        public AppInstaller()
        {
            InitializeComponent();
            Helper.Init(Assembly.GetExecutingAssembly());

            installFolder = Helper.GetAssemblyFolder(Assembly.GetExecutingAssembly());

            //-----------------------------------------------------------------
            // Add a LillTek InstallTools installer instance.

            installTools = new InstallTools(Const.BroadcastServerName + " Setup", installFolder, "BroadcastServerInstall.cmd");
            this.Installers.Add(installTools);

            //-----------------------------------------------------------------
            // Add the Windows Service Installer

            this.serviceInstaller        = new ServiceInstaller();
            this.serviceProcessInstaller = new ServiceProcessInstaller();

            this.serviceInstaller.DisplayName      = Const.BroadcastServerName;
            this.serviceInstaller.ServiceName      = Const.BroadcastServerName;
            this.serviceInstaller.StartType        = ServiceStartMode.Automatic;
            this.serviceInstaller.DelayedAutoStart = true;


            this.serviceProcessInstaller.Account  = ServiceAccount.LocalSystem;
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;

            this.Installers.AddRange(new System.Configuration.Install.Installer[]
            {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });

            //-----------------------------------------------------------------
            // Do some work that the service installer is too stupid to do.

            // Start the service after setup terminates.

            installTools.StartService(Const.BroadcastServerName);

            // Add the service description to the registry.

            installTools.AddRegValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\" + Const.BroadcastServerName + @":Description",
                                     "Implements UDP broadcasting for networks that do not support multicast or native UDP broadcast.");
        }
Пример #5
0
        /// <summary>
        /// Constructs a CoreAppInstaller instance.
        /// </summary>
        public CoreAppInstaller()
        {
            InitializeComponent();
            Helper.InitializeApp(Assembly.GetExecutingAssembly());

            installFolder = Helper.GetAssemblyFolder(Assembly.GetExecutingAssembly());

            //-----------------------------------------------------------------
            // Add a LillTek InstallTools installer instance.

            installTools = new InstallTools(SwitchConst.NeonSwitchName + " Setup", installFolder, "NeonSwitchInstall.cmd");
            this.Installers.Add(installTools);

            //-----------------------------------------------------------------
            // Add the Windows Service Installer

            this.serviceInstaller        = new ServiceInstaller();
            this.serviceProcessInstaller = new ServiceProcessInstaller();

            this.serviceInstaller.DisplayName      = SwitchConst.NeonSwitchName;
            this.serviceInstaller.ServiceName      = SwitchConst.NeonSwitchName;
            this.serviceInstaller.StartType        = ServiceStartMode.Automatic;
            this.serviceInstaller.DelayedAutoStart = true;

            this.serviceProcessInstaller.Account  = ServiceAccount.LocalSystem;
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;

            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });

            //-----------------------------------------------------------------
            // Do some work that the service installer is too stupid to do.

            // Start the service after setup terminates.

            installTools.StartService(SwitchConst.NeonSwitchName);

            // Add the service description to the registry.

            installTools.AddRegValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\" + SwitchConst.NeonSwitchName + @":Description",
                                     "NeonSwitch Telephony Platform.");
        }
Пример #6
0
        private void InstallTools_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            if (vms.All(v => Helpers.StockholmOrGreater(v.Connection)))
            {
                Help.HelpManager.Launch("InstallToolsWarningDialog");
                return;
            }

            var cmd = new InstallToolsCommand(Program.MainWindow, vms);

            cmd.InstallTools += _ => InstallTools?.Invoke();
            cmd.Execute();
        }
Пример #7
0
        /// <summary>
        /// Attempts to install tools on several VMs
        /// </summary>
        /// <param name="vms"></param>
        /// <returns>Whether the action was launched (i.e., the user didn't Cancel)</returns>
        private void MultipleVMExecute(List <VM> vms)
        {
            bool newDvdDrivesRequired = false;

            foreach (VM vm in vms)
            {
                if (CanExecute(vm) && vm.FindVMCDROM() == null)
                {
                    newDvdDrivesRequired = true;
                    break;
                }
            }

            if (newDvdDrivesRequired)
            {
                DialogResult dialogResult;
                using (var dlg = new WarningDialog(Messages.NEW_DVD_DRIVES_REQUIRED,
                                                   ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo))
                {
                    dialogResult = dlg.ShowDialog(Parent);
                }
                if (dialogResult == DialogResult.Yes)
                {
                    foreach (VM vm in vms)
                    {
                        if (CanExecute(vm) && vm.FindVMCDROM() == null)
                        {
                            //do not register the event ShowUserInstruction; we show explicitly a message afterwards
                            var createDriveAction = new CreateCdDriveAction(vm);

                            using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
                            {
                                dlg.ShowDialog(Parent);
                            }
                        }
                    }
                    ShowMustRebootBox();
                    InstallTools?.Invoke(null);
                }
            }
            else
            {
                using (var dlg = new WarningDialog(Messages.XS_TOOLS_MESSAGE_MORE_THAN_ONE_VM,
                                                   new ThreeButtonDialog.TBDButton(Messages.INSTALL_XENSERVER_TOOLS_BUTTON,
                                                                                   DialogResult.OK, ThreeButtonDialog.ButtonType.ACCEPT, true),
                                                   ThreeButtonDialog.ButtonCancel)
                {
                    ShowLinkLabel = true,
                    LinkText = Messages.INSTALLTOOLS_READ_MORE,
                    LinkAction = () => Help.HelpManager.Launch("InstallToolsWarningDialog")
                })
                    if (dlg.ShowDialog(Parent) == DialogResult.OK && CheckToolSrs(vms.ToArray()))
                    {
                        foreach (VM vm in vms)
                        {
                            var installToolsAction = new InstallPVToolsAction(vm, Properties.Settings.Default.ShowHiddenVMs);

                            if (vms.IndexOf(vm) == 0)
                            {
                                installToolsAction.Completed += FirstInstallToolsActionCompleted;
                            }
                            else
                            {
                                installToolsAction.Completed += InstallToolsActionCompleted;
                            }

                            installToolsAction.RunAsync();
                        }

                        InstallTools?.Invoke(null);
                    }
            }
        }