public override void BeginInstall(InstallerControl control) { if (_hasInstallers) { _installControl = control; _installManager.StartInstallation(); WaitForInstallationToComplete(); } }
public void SetupInstall(string[] productList) { _hasInstallers = false; _installControl = null; _installManager = new InstallManager(); _productList = new List <string>(); _installManager.InstallerStatusUpdated += new EventHandler <InstallStatusEventArgs>(InstallerStatusUpdated); _installManager.InstallCompleted += new EventHandler <EventArgs>(InstallerCompletedCallback); var productManager = new ProductManager(); // Load feed specifying that enclosure files are needed. productManager.Load(new Uri(WebPiFeedUrl), true, true, false, Path.GetTempPath()); var productsToInstall = new List <Product>(); var uniqueInstallerList = new Dictionary <string, Installer>(StringComparer.OrdinalIgnoreCase); var languageOfInstallers = productManager.GetLanguage(Thread.CurrentThread.CurrentCulture.ToString()); var english = productManager.GetLanguage("en"); foreach (var productName in productList) { Product product = productManager.GetProduct(productName); LogInformation("Initial Product to install: {0}", product.ProductId); if (!product.IsInstalled(true)) { AddProductWithDependencies(product, productsToInstall); foreach (Product productToInstall in productsToInstall) { Installer currentInstaller = productToInstall.GetInstaller(languageOfInstallers); if (currentInstaller == null) { currentInstaller = productToInstall.GetInstaller(english); } if (currentInstaller != null) { if (!uniqueInstallerList.ContainsKey(currentInstaller.Product.ProductId)) { uniqueInstallerList[currentInstaller.Product.ProductId] = currentInstaller; LogInformation("Adding product: {0}", currentInstaller.Product.ProductId); _productList.Add(currentInstaller.Product.ProductId); } _hasInstallers = true; } } } } if (_hasInstallers) { _installManager.Load(uniqueInstallerList.Values); } }
private void ReplaceContentControl(int index) { if (currentContentControl != null) { } if (index == 0) { prevButton.Enabled = false; nextButton.Enabled = true; } else if (index == (contentControls.Count - 1)) { prevButton.Enabled = true; nextButton.Enabled = false; } else { prevButton.Enabled = true; nextButton.Enabled = true; } InstallerControl newContentControl = contentControls[index]; newContentControl.Dock = DockStyle.Fill; titleLabel.Text = newContentControl.Title; subTitleLabel.Text = newContentControl.SubTitle; contentPanel.Controls.Clear(); contentPanel.Controls.Add(newContentControl); newContentControl.Open(); currentContentControl = newContentControl; }
public abstract void BeginInstall(InstallerControl control);