public override void UpdateUI() { lblLAV.Text = Localizer.GetBestTranslation("ExtensionChoice_LAV"); linkExtensions.Text = Localizer.GetBestTranslation("ExtensionChoice_OtherExtensions"); linkLAV.Text = Localizer.GetBestTranslation("ExtensionChoice_MoreInfo"); lblRecommended.Text = Localizer.GetBestTranslation("ExtensionChoice_Title"); }
public override void UpdateUI() { labelHeading.Text = Localizer.GetBestTranslation("TvServerSettings_labelHeading"); labelInstDir.Text = Localizer.GetBestTranslation("TvServerSettings_labelInstDir"); checkBoxFirewall.Text = Localizer.GetBestTranslation("TvServerSettings_checkBoxFirewall"); buttonBrowse.Text = Localizer.GetBestTranslation("MainWindow_browseButton"); }
public SkinChoice() { InitializeComponent(); type = DialogType.SkinChoice; labelSectionHeader.Text = ""; if (InstallationProperties.Instance.Get("UpdateMode") == "yes") { lblExisting.Text = Localizer.GetBestTranslation("SkinChoice_labelExistingSkin"); btnExisting.Visible = true; lblExisting.Visible = true; btnExisting.Image = Images.Choose_button_on; pbSkin.Image = null; InstallationProperties.Instance.Set("ChosenSkin", "[Existing]"); } else { float screenHeight = Screen.PrimaryScreen.Bounds.Height; float screenWidth = Screen.PrimaryScreen.Bounds.Width; float screenRatio = (screenWidth / screenHeight); bool widescreen = screenRatio > 1.5; if (widescreen) { // default to Titan btnTitan.Image = Images.Choose_button_on; pbSkin.Image = Images.preview_titan; InstallationProperties.Instance.Set("ChosenSkin", "Titan"); } } UpdateUI(); }
public override DeployDialog GetNextDialog() { progressInstall.Minimum = 0; progressInstall.Maximum = flpApplication.Controls.Count; progressInstall.Value = 0; progressInstall.Visible = true; foreach (Control item in flpApplication.Controls) { progressInstall.Value++; progressInstall.Update(); IInstallationPackage package = (IInstallationPackage)((ApplicationCtrl)item).Tag; int action = PerformPackageAction(package, (ApplicationCtrl)item); ((ApplicationCtrl)item).InAction = false; item.Update(); if (action == 2) { ((ApplicationCtrl)item).StatusName = CheckState.FAILED.ToString(); break; } if (action == 1) { ((ApplicationCtrl)item).State = Localizer.GetBestTranslation("Install_stateInstalled"); ((ApplicationCtrl)item).Action = Localizer.GetBestTranslation("Install_actionNothing"); ((ApplicationCtrl)item).StatusName = CheckState.COMPLETE.ToString(); } item.Update(); progressInstall.Update(); } // PopulateListView(); progressInstall.Visible = false; return(DialogFlowHandler.Instance.GetDialogInstance(DialogType.Finished)); }
public override void UpdateUI() { labelOneClickCaption.Text = Localizer.GetBestTranslation("BaseInstallation_labelOneClickCaption"); labelOneClickDesc.Text = Localizer.GetBestTranslation("BaseInstallationNoTvEngine_labelOneClickDesc"); rbOneClick.Text = Localizer.GetBestTranslation("BaseInstallation_rbOneClick"); labelAdvancedCaption.Text = Localizer.GetBestTranslation("BaseInstallation_labelAdvancedCaption"); labelAdvancedDesc.Text = Localizer.GetBestTranslation("BaseInstallationNoTvEngine_labelAdvancedDesc"); rbAdvanced.Text = Localizer.GetBestTranslation("BaseInstallation_rbAdvanced"); }
public override bool SettingsValid() { if (!Utils.CheckTargetDir(textBoxDir.Text)) { Utils.ErrorDlg(Localizer.GetBestTranslation("TvServerSettings_errInvalidPath")); return(false); } return(true); }
public MPSettingsDlg() { InitializeComponent(); type = DialogType.MPSettings; textBoxDir.Text = installationPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\Team MediaPortal\\MediaPortal"; checkBoxFirewall.Text = Localizer.GetBestTranslation("MPSettings_checkBoxFirewall"); UpdateUI(); }
public override void UpdateUI() { labelSectionHeader.Text = Localizer.GetBestTranslation("CustomInstallation_labelSectionHeader"); rbSingleSeat.Text = Localizer.GetBestTranslation("CustomInstallation_rbSingleSeat"); labelSingleSeat.Text = Localizer.GetBestTranslation("CustomInstallation_labelSingleSeat"); rbTvServerMaster.Text = Localizer.GetBestTranslation("CustomInstallation_rbTvServerMaster"); labelMaster.Text = Localizer.GetBestTranslation("CustomInstallation_labelMaster"); rbClient.Text = Localizer.GetBestTranslation("CustomInstallation_rbClient"); labelClient.Text = Localizer.GetBestTranslation("CustomInstallation_labelClient"); }
private void buttonBrowse_Click(object sender, EventArgs e) { FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = Localizer.GetBestTranslation("DBMSSettings_msgSelectDir"); dlg.SelectedPath = textBoxDir.Text; if (dlg.ShowDialog() == DialogResult.OK) { textBoxDir.Text = dlg.SelectedPath; } }
private void buttonBrowse_Click(object sender, EventArgs e) { FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = Localizer.GetBestTranslation("TvServerSettings_msgSelectDir"); dlg.SelectedPath = textBoxDir.Text; if (dlg.ShowDialog() == DialogResult.OK) { textBoxDir.Text = Path.Combine(dlg.SelectedPath, "MediaPortal TV Server"); } }
public override void UpdateUI() { // This change the description of "Next" button to "Install" or "Download" InstallationProperties.Instance.Set("Install_Dialog", "yes"); labelHeading.Text = InstallationProperties.Instance["InstallType"] == "download_only" ? Localizer.GetBestTranslation("Install_labelHeadingDownload") : Localizer.GetBestTranslation("Install_labelHeadingInstall"); listView.Columns[0].Text = Localizer.GetBestTranslation("Install_colApplication"); listView.Columns[1].Text = Localizer.GetBestTranslation("Install_colState"); listView.Columns[2].Text = Localizer.GetBestTranslation("Install_colAction"); labelSectionHeader.Text = ""; }
public override bool SettingsValid() { if (!Utils.CheckTargetDir(textBoxDir.Text)) { Utils.ErrorDlg(Localizer.GetBestTranslation("DBMSSettings_errInvalidInstallationPath")); return(false); } if (textBoxPassword.Text == "") { Utils.ErrorDlg(Localizer.GetBestTranslation("DBMSSettings_errPasswordMissing")); return(false); } return(true); }
public override void SetProperties() { if (rbOneClickChecked) { InstallationProperties.Instance.Set("InstallTypeHeader", Localizer.GetBestTranslation("BaseInstallation_rbOneClick")); InstallationProperties.Instance.Set("InstallType", "singleseat"); InstallationProperties.Instance.Set("ConfigureTVServerFirewall", "1"); InstallationProperties.Instance.Set("ConfigureMediaPortalFirewall", "1"); InstallationProperties.Instance.Set("ConfigureDBMSFirewall", "1"); InstallationProperties.Instance.Set("DBMSPassword", "MediaPortal"); // Default DBMS InstallationProperties.Instance.Set("DBMSType", "mysql"); InstallationProperties.Instance.Set("DBMSDir", InstallationProperties.Instance["ProgramFiles"] + "\\MySQL\\MySQL Server 5.1"); } }
public override void UpdateUI() { labelHeading1.Text = Localizer.GetBestTranslation("Finished_labelHeading1"); if (InstallationProperties.Instance["InstallType"] == "download_only") { labelHeading2.Text = Localizer.GetBestTranslation("Finished_labelHeading2_download"); labelHeading3.Text = Localizer.GetBestTranslation("Finished_labelHeading3_download"); labelHeading3.Location = new Point(labelHeading3.Location.X, 79); } else { labelHeading2.Text = Localizer.GetBestTranslation("Finished_labelHeading2_install"); labelHeading3.Text = Localizer.GetBestTranslation("Finished_labelHeading3_install"); } linkHomepage.Text = Localizer.GetBestTranslation("Finished_linkHomepage"); linkForum.Text = Localizer.GetBestTranslation("Finished_linkForum"); linkWiki.Text = Localizer.GetBestTranslation("Finished_linkWiki"); labelEbay.Text = Localizer.GetBestTranslation("Finished_labelEbay"); labelSectionHeader.Text = ""; }
public override void UpdateUI() { labelHeading.Text = Localizer.GetBestTranslation("DBMSType_labelHeading"); rbMSSQL.Text = Localizer.GetBestTranslation("DBMSType_rbMSSQL"); rbMySQL.Text = Localizer.GetBestTranslation("DBMSType_rbMySQL"); rbDBAlreadyInstalled.Text = Localizer.GetBestTranslation("DBMSType_rbDBAlreadyInstalled"); //MSSQL2005 is not supported on Windows 7 and later if (OSInfo.OSInfo.Win7OrLater()) { bMS.Enabled = false; // For better readability label is not disabled, only the eventhandler is removed rbMSSQL.Click -= bMS_Click; rbMSSQL.Cursor = DefaultCursor; rbMSSQL.ForeColor = Color.DimGray; rbMSSQL.Text = Localizer.GetBestTranslation("DBMSType_rbMSSQL_disabled"); lbMSSQL.Visible = true; lbMSSQL.Enabled = true; lbMSSQL.Text = Localizer.GetBestTranslation("DBMSType_lbMSSQL_disabled"); } }
public override DeployDialog GetNextDialog() { foreach (ListViewItem item in listView.Items) { IInstallationPackage package = (IInstallationPackage)item.Tag; int action = PerformPackageAction(package, item); item.UseItemStyleForSubItems = false; item.SubItems[1].Font = new Font(item.SubItems[1].Font, FontStyle.Regular); listView.Update(); if (action == 2) { break; } if (action == 1) { item.SubItems[1].Text = Localizer.GetBestTranslation("Install_stateInstalled"); item.SubItems[2].Text = Localizer.GetBestTranslation("Install_actionNothing"); item.ImageIndex = 0; } } PopulateListView(); return(DialogFlowHandler.Instance.GetDialogInstance(DialogType.Finished)); }
public override void UpdateUI() { labelSectionHeader.Text = Localizer.GetBestTranslation("DownloadSettings_labelSectionHeader"); }
private void AddPackageToListView(IInstallationPackage package) { listView.SmallImageList = iconsList; ListViewItem item = listView.Items.Add(package.GetDisplayName()); item.Tag = package; CheckResult result = package.CheckStatus(); switch (result.state) { case CheckState.INSTALLED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateInstalled")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionNothing")); item.ImageIndex = 0; break; case CheckState.NOT_INSTALLED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateNotInstalled")); if (result.needsDownload) { item.SubItems.Add(Localizer.GetBestTranslation("Install_actionDownloadInstall")); } else { item.SubItems.Add(Localizer.GetBestTranslation("Install_actionInstall")); } item.ImageIndex = 1; break; case CheckState.CONFIGURED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateConfigured")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionNothing")); item.ImageIndex = 0; break; case CheckState.NOT_CONFIGURED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateNotConfigured")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionConfigure")); item.ImageIndex = 1; break; case CheckState.REMOVED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateRemoved")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionNothing")); item.ImageIndex = 0; break; case CheckState.NOT_REMOVED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateUninstall")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionRemove")); item.ImageIndex = 1; break; case CheckState.DOWNLOADED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateDownloaded")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionNothing")); item.ImageIndex = 0; break; case CheckState.NOT_DOWNLOADED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateNotDownloaded")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionDownload")); item.ImageIndex = 1; break; case CheckState.VERSION_MISMATCH: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateVersionMismatch")); if (result.needsDownload) { item.SubItems.Add(Localizer.GetBestTranslation("Install_actionUninstallDownloadInstall")); } else { if (InstallationProperties.Instance["UpdateMode"] == "yes") { item.SubItems.Add(Localizer.GetBestTranslation("Install_actionUpgradeInstall")); } else { item.SubItems.Add(Localizer.GetBestTranslation("Install_actionUninstallInstall")); } } item.ImageIndex = 2; break; case CheckState.SKIPPED: item.SubItems.Add(Localizer.GetBestTranslation("Install_stateSkipped")); item.SubItems.Add(Localizer.GetBestTranslation("Install_actionNothing")); item.ImageIndex = 0; break; } }
private void AddPackageToListView(IInstallationPackage package) { ApplicationCtrl item = new ApplicationCtrl(); item.Name = package.GetDisplayName(); item.IconName = package.GetIconName(); item.Tag = package; CheckResult result = package.CheckStatus(); item.StatusName = result.state.ToString(); switch (result.state) { case CheckState.INSTALLED: item.State = Localizer.GetBestTranslation("Install_stateInstalled"); item.Action = Localizer.GetBestTranslation("Install_actionNothing"); break; case CheckState.NOT_INSTALLED: item.State = Localizer.GetBestTranslation("Install_stateNotInstalled"); if (result.needsDownload) { item.Action = Localizer.GetBestTranslation("Install_actionDownloadInstall"); } else { item.Action = Localizer.GetBestTranslation("Install_actionInstall"); } break; case CheckState.CONFIGURED: item.State = Localizer.GetBestTranslation("Install_stateConfigured"); item.Action = Localizer.GetBestTranslation("Install_actionNothing"); break; case CheckState.NOT_CONFIGURED: item.State = Localizer.GetBestTranslation("Install_stateNotConfigured"); item.Action = Localizer.GetBestTranslation("Install_actionConfigure"); break; case CheckState.REMOVED: item.State = Localizer.GetBestTranslation("Install_stateRemoved"); item.Action = Localizer.GetBestTranslation("Install_actionNothing"); break; case CheckState.NOT_REMOVED: item.State = Localizer.GetBestTranslation("Install_stateUninstall"); item.Action = Localizer.GetBestTranslation("Install_actionRemove"); break; case CheckState.DOWNLOADED: item.State = Localizer.GetBestTranslation("Install_stateDownloaded"); item.Action = Localizer.GetBestTranslation("Install_actionNothing"); break; case CheckState.NOT_DOWNLOADED: item.State = Localizer.GetBestTranslation("Install_stateNotDownloaded"); item.Action = Localizer.GetBestTranslation("Install_actionDownload"); break; case CheckState.VERSION_MISMATCH: item.State = Localizer.GetBestTranslation("Install_stateVersionMismatch"); if (result.needsDownload) { item.Action = Localizer.GetBestTranslation("Install_actionUninstallDownloadInstall"); } else { if (InstallationProperties.Instance["UpdateMode"] == "yes") { item.Action = Localizer.GetBestTranslation("Install_actionUpgradeInstall"); } else { item.Action = Localizer.GetBestTranslation("Install_actionUninstallInstall"); } } break; case CheckState.SKIPPED: item.State = Localizer.GetBestTranslation("Install_stateSkipped"); item.Action = Localizer.GetBestTranslation("Install_actionNothing"); break; } flpApplication.Controls.Add(item); }
public override void UpdateUI() { // // Disable upgrade if installed version is different from previous or SVN is installed // es1. 1.0.1 is current, installed must be 1.0.0 // es2. 1.0 SVN XXXXX is installed // // MediaPortal int major = 0; int minor = 0; int revision = 0; RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MediaPortal"); string MpBuild = "0"; string MpDisplayVer = string.Empty; if (key != null) { MpBuild = key.GetValue("VersionBuild").ToString(); major = (int)key.GetValue("VersionMajor", 0); minor = (int)key.GetValue("VersionMinor", 0); revision = (int)key.GetValue("VersionRevision", 0); MpDisplayVer = key.GetValue("DisplayVersion").ToString().Replace(" for TESTING ONLY", string.Empty); key.Close(); } Version MpVer = new Version(major, minor, revision); // TV-Server major = 0; minor = 0; revision = 0; key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MediaPortal TV Server"); string Tv3Build = "0"; string Tv3DisplayVer = string.Empty; if (key != null) { Tv3Build = key.GetValue("VersionBuild").ToString(); major = (int)key.GetValue("VersionMajor", 0); minor = (int)key.GetValue("VersionMinor", 0); revision = (int)key.GetValue("VersionRevision", 0); Tv3DisplayVer = key.GetValue("DisplayVersion").ToString().Replace(" for TESTING ONLY", string.Empty); key.Close(); } Version Tv3Ver = new Version(major, minor, revision); rbUpdate.Enabled = false; bUpdate.Enabled = false; if ((Utils.IsPackageUpdatabled(MpVer) || Utils.IsPackageUpdatabled(Tv3Ver)) && (Utils.IsOfficialBuild(MpBuild) && Utils.IsOfficialBuild(Tv3Build))) { rbUpdate.Enabled = true; bUpdate.Enabled = true; } var strMPDisplayVer = MpDisplayVer; if (MpVer.Major == 1 && MpVer.Minor == 1) { switch (MpVer.Build) { case 6: strMPDisplayVer = "1.2.0 Alpha"; break; case 7: strMPDisplayVer = "1.2.0 Beta"; break; case 8: strMPDisplayVer = "1.2.0 RC"; break; } } var strTVDisplayVer = Tv3DisplayVer; if (Tv3Ver.Major == 1 && Tv3Ver.Minor == 1) { switch (Tv3Ver.Build) { case 6: strTVDisplayVer = "1.2.0 Alpha"; break; case 7: strTVDisplayVer = "1.2.0 Beta"; break; case 8: strTVDisplayVer = "1.2.0 RC"; break; } } if (!String.IsNullOrEmpty(MpBuild)) { labelSectionHeader.Text = !Utils.IsOfficialBuild(MpBuild) ? String.Format(Localizer.GetBestTranslation("Upgrade_labelSectionHeader_SVN"), strMPDisplayVer, MpBuild) : String.Format(Localizer.GetBestTranslation("Upgrade_labelSectionHeader"), strMPDisplayVer); } else { labelSectionHeader.Text = !Utils.IsOfficialBuild(Tv3Build) ? String.Format(Localizer.GetBestTranslation("Upgrade_labelSectionHeader_SVN"), strTVDisplayVer, Tv3Build) : String.Format(Localizer.GetBestTranslation("Upgrade_labelSectionHeader"), strTVDisplayVer); } rbUpdate.Text = String.Format(Localizer.GetBestTranslation("Upgrade_yes"), Utils.GetDisplayVersion()); rbFresh.Text = Localizer.GetBestTranslation("Upgrade_no"); labelNote.Text = Localizer.GetBestTranslation("Upgrade_note"); }
public override void UpdateUI() { labelSectionHeader.Text = Localizer.GetBestTranslation("WatchTV_labelSectionHeader"); rbYesWatchTv.Text = Localizer.GetBestTranslation("WatchTV_on"); rbNoWatchTv.Text = Localizer.GetBestTranslation("WatchTV_off"); }
public override void UpdateUI() { labelHeading.Text = Localizer.GetBestTranslation("MPSettings_labelHeading"); labelInstDir.Text = Localizer.GetBestTranslation("MPSettings_labelInstDir"); buttonBrowse.Text = Localizer.GetBestTranslation("MainWindow_browseButton"); }
public override void UpdateUI() { linkMySQL.Text = Localizer.GetBestTranslation("MySQLChoice_MoreInfo"); lblRecommended.Text = Localizer.GetBestTranslation("MySQLChoice_Title"); lblMySQLText.Text = Localizer.GetBestTranslation("MySQLChoice_Information"); }
private int PerformPackageAction(IInstallationPackage package, ApplicationCtrl item) { // // return 0: nothing to do // 1: install successufull // 2: install error // if (package == null) { return(2); } CheckResult result = package.CheckStatus(); if (result.state != CheckState.INSTALLED && result.state != CheckState.REMOVED && result.state != CheckState.DOWNLOADED && result.state != CheckState.SKIPPED) { item.InAction = true; item.StatusName = CheckState.PROGRESS.ToString(); switch (result.state) { case CheckState.NOT_INSTALLED: if (result.needsDownload) { item.Action = Localizer.GetBestTranslation("Install_msgDownloading"); item.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } } item.Action = Localizer.GetBestTranslation("Install_msgInstalling"); item.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_CONFIGURED: item.Action = Localizer.GetBestTranslation("Install_msgConfiguring"); item.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errConfigureFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_REMOVED: item.Action = Localizer.GetBestTranslation("Install_msgUninstalling"); item.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errRemoveFailed"), package.GetDisplayName())); return(2); } break; case CheckState.VERSION_MISMATCH: item.Action = Localizer.GetBestTranslation("Install_msgUninstalling"); item.Update(); if (!package.UnInstall()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errUinstallFailed"), package.GetDisplayName())); return(2); } if (result.needsDownload) { item.Action = Localizer.GetBestTranslation("Install_msgDownloading"); item.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errDownloadFailed"), package.GetDisplayName())); return(2); } } item.Action = Localizer.GetBestTranslation("Install_msgInstalling"); item.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_DOWNLOADED: item.Action = Localizer.GetBestTranslation("Install_msgDownloading"); item.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errDownloadFailed"), package.GetDisplayName())); return(2); } break; } return(1); } item.StatusName = result.state.ToString(); return(0); }
public override void UpdateUI() { lblChooseSkin.Text = Localizer.GetBestTranslation("SkinChoice_labelSectionHeader"); }
public override void UpdateUI() { labelSectionHeader.Text = Localizer.GetBestTranslation("DownloadOnly_labelSectionHeader"); rbDownloadOnly.Text = Localizer.GetBestTranslation("DownloadOnly_no"); rbInstallNow.Text = Localizer.GetBestTranslation("DownloadOnly_yes"); }
public bool Install() { if (!File.Exists(_fileName)) { return(false); } // If we have a deploy.xml left over from previous installation then attempt to delete it var deployXml = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Team MediaPortal\MediaPortal\deploy.xml"; if (File.Exists(deployXml)) { try { File.Delete(deployXml); } catch (Exception ex) { var result = MessageBox.Show(Localizer.GetBestTranslation("MainWindow_AppName"), Localizer.GetBestTranslation("DeployXmlDelete_Failed"), MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error); switch (result) { case DialogResult.Abort: Environment.Exit(-2); break; case DialogResult.Ignore: break; case DialogResult.Retry: return(Install()); } } } //if user has chosen a skin then update deploy.xml so this is picked up by MP //if no skin has been chosed (user has selected one click install) then set one var chosenSkin = InstallationProperties.Instance.Get("ChosenSkin"); if (string.IsNullOrEmpty(chosenSkin)) { chosenSkin = "Titan"; } if (InstallationProperties.Instance["UpdateMode"] == "yes") { if (chosenSkin != "[Existing]") { Utils.SetDeployXml("skin", "name", chosenSkin); } } // Remove PowerScheduler++ information from installed extensions string InstalledMpesPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Team MediaPortal\MediaPortal\Installer\V2\InstalledExtensions.xml"; XmlDocument doc = new XmlDocument(); try { // Load the installed extensions file doc.Load(InstalledMpesPath); // Get all PackageClass nodes XmlNodeList packageClassNodes = doc.SelectNodes("/ExtensionCollection/Items/PackageClass"); foreach (XmlNode packageClassNode in packageClassNodes) { // Remove node if GeneralInfo/Name is PowerSchedeuler++ XmlNode idNode = packageClassNode.SelectSingleNode("GeneralInfo/Id"); if (idNode.InnerText == "9b9bc24e-69ca-4abc-8810-f8f95bd4bbe6") { packageClassNode.ParentNode.RemoveChild(packageClassNode); doc.Save(InstalledMpesPath); break; } } } catch (Exception) { } string targetDir = InstallationProperties.Instance["MPDir"]; //NSIS installer need to know if it's a fresh install or an update (chefkoch) string UpdateMode = InstallationProperties.Instance["UpdateMode"] == "yes" ? "/UpdateMode" : string.Empty; Process setup = null; if (UpgradeDlg.reInstallForce) { setup = Process.Start(_fileName, String.Format("/S /DeployMode --DeployMode /UpdateMode")); } else { //NSIS installer doesn't want " in parameters (chefkoch) //Remember that /D must be the last one (chefkoch) setup = Process.Start(_fileName, String.Format("/S /DeployMode --DeployMode {0} /D={1}", UpdateMode, targetDir)); } if (setup != null) { setup.WaitForExit(); if (setup.ExitCode == 0) { if (File.Exists(targetDir + "\\reboot")) { Utils.NotifyReboot(GetDisplayName()); } // installer backups existing folder so need to write deploy.xml after installation // else it will get backed up if (InstallationProperties.Instance["UpdateMode"] != "yes") { if (chosenSkin != "[Existing]") { Utils.SetDeployXml("skin", "name", chosenSkin); } } return(true); } } return(false); }
public override void UpdateUI() { labelHeading1.Text = Localizer.GetBestTranslation("Welcome_labelHeading1"); labelHeading2.Text = Localizer.GetBestTranslation("Welcome_labelHeading2"); labelHeading3.Text = Localizer.GetBestTranslation("Welcome_labelHeading3"); }
public bool Install() { if (!File.Exists(_fileName)) { return(false); } // If we have a deploy.xml left over from previous installation then attempt to delete it var deployXml = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Team MediaPortal\MediaPortal\deploy.xml"; if (File.Exists(deployXml)) { try { File.Delete(deployXml); } catch (Exception ex) { var result = MessageBox.Show(Localizer.GetBestTranslation("MainWindow_AppName"), Localizer.GetBestTranslation("DeployXmlDelete_Failed"), MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error); switch (result) { case DialogResult.Abort: Environment.Exit(-2); break; case DialogResult.Ignore: break; case DialogResult.Retry: return(Install()); } } } //if user has chosen a skin then update deploy.xml so this is picked up by MP //if no skin has been chosed (user has selected one click install) then set one var chosenSkin = InstallationProperties.Instance.Get("ChosenSkin"); if (string.IsNullOrEmpty(chosenSkin)) { chosenSkin = "Titan"; } if (InstallationProperties.Instance["UpdateMode"] == "yes") { if (chosenSkin != "[Existing]") { Utils.SetDeployXml("skin", "name", chosenSkin); } } string targetDir = InstallationProperties.Instance["MPDir"]; //NSIS installer need to know if it's a fresh install or an update (chefkoch) string UpdateMode = InstallationProperties.Instance["UpdateMode"] == "yes" ? "/UpdateMode" : string.Empty; //NSIS installer doesn't want " in parameters (chefkoch) //Remember that /D must be the last one (chefkoch) Process setup = Process.Start(_fileName, String.Format("/S /DeployMode --DeployMode {0} /D={1}", UpdateMode, targetDir)); if (setup != null) { setup.WaitForExit(); if (setup.ExitCode == 0) { if (File.Exists(targetDir + "\\reboot")) { Utils.NotifyReboot(GetDisplayName()); } // installer backups existing folder so need to write deploy.xml after installation // else it will get backed up if (InstallationProperties.Instance["UpdateMode"] != "yes") { if (chosenSkin != "[Existing]") { Utils.SetDeployXml("skin", "name", chosenSkin); } } return(true); } } return(false); }
private int PerformPackageAction(IInstallationPackage package, ListViewItem item) { // // return 0: nothing to do // 1: install successufull // 2: install error // CheckResult result = package.CheckStatus(); if (result.state != CheckState.INSTALLED && result.state != CheckState.REMOVED && result.state != CheckState.DOWNLOADED && result.state != CheckState.SKIPPED) { item.UseItemStyleForSubItems = false; item.SubItems[1].Font = new Font(item.SubItems[1].Font, FontStyle.Bold); switch (result.state) { case CheckState.NOT_INSTALLED: if (result.needsDownload) { item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgDownloading"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } } item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgInstalling"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_CONFIGURED: item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgConfiguring"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errConfigureFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_REMOVED: item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgUninstalling"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errRemoveFailed"), package.GetDisplayName())); return(2); } break; case CheckState.VERSION_MISMATCH: item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgUninstalling"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.UnInstall()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errUinstallFailed"), package.GetDisplayName())); return(2); } if (result.needsDownload) { item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgDownloading"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errDownloadFailed"), package.GetDisplayName())); return(2); } } item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgInstalling"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Install()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errInstallFailed"), package.GetDisplayName())); return(2); } break; case CheckState.NOT_DOWNLOADED: item.SubItems[1].Text = Localizer.GetBestTranslation("Install_msgDownloading"); listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listView.Update(); if (!package.Download()) { Utils.ErrorDlg(string.Format(Localizer.GetBestTranslation("Install_errDownloadFailed"), package.GetDisplayName())); return(2); } break; } return(1); } return(0); }