Beispiel #1
0
        public static string GetDownloadString(string session_id, string node_id)
        {
            XmlDocument  doc     = new XmlDocument();
            HTTPDownload dlg     = new HTTPDownload();
            string       XmlFile = Application.StartupPath + "\\ApplicationLocations.xml";
            const string XmlUrl  = "http://install.team-mediaportal.com/DeployTool/ApplicationLocations.xml";

            //HTTP update of the xml file with the application download URLs
            if (!File.Exists(XmlFile))
            {
                dlg.ShowDialog(XmlUrl, XmlFile, GetUserAgentOsString());
            }
            try
            {
                doc.Load(XmlFile);
                XmlNode node = doc.SelectSingleNode("/Applications/" + session_id + "/" + node_id);
                return(node.InnerText);
            }
            catch
            {
                MessageBox.Show(Localizer.GetBestTranslation("DownloadSettings_failed"), XmlUrl, MessageBoxButtons.OK,
                                MessageBoxIcon.Stop);
                File.Delete(XmlFile);
                Environment.Exit(-2);
            }
            return(String.Empty);
        }
Beispiel #2
0
        public static DialogResult DownloadFile(string FileName, string prg)
        {
            DialogResult result;

            if (GetDownloadString(prg, "TYPE") == "Manual")
            {
                ManualDownload dlg = new ManualDownload();
                result = dlg.ShowDialog(GetDownloadString(prg, "URL"), Path.GetFileName(FileName),
                                        Application.StartupPath + "\\deploy");
            }
            else
            {
                HTTPDownload dlg = new HTTPDownload();
                result = dlg.ShowDialog(GetDownloadString(prg, "URL"), FileName, GetUserAgentOsString());
            }
            return(result);
        }
Beispiel #3
0
    public static DialogResult DownloadFile(string FileName, string prg)
    {
      DialogResult result;

      if (GetDownloadString(prg, "TYPE") == "Manual")
      {
        ManualDownload dlg = new ManualDownload();
        result = dlg.ShowDialog(GetDownloadString(prg, "URL"), Path.GetFileName(FileName),
                                Application.StartupPath + "\\deploy");
      }
      else
      {
        HTTPDownload dlg = new HTTPDownload();
        result = dlg.ShowDialog(GetDownloadString(prg, "URL"), FileName, GetUserAgentOsString());
      }
      return result;
    }
Beispiel #4
0
    public static string GetDownloadString(string session_id, string node_id)
    {
      XmlDocument doc = new XmlDocument();
      HTTPDownload dlg = new HTTPDownload();
      string XmlFile = Application.StartupPath + "\\ApplicationLocations.xml";
      const string XmlUrl = "http://install.team-mediaportal.com/DeployTool/ApplicationLocations.xml";

      //HTTP update of the xml file with the application download URLs
      if (!File.Exists(XmlFile))
      {
        dlg.ShowDialog(XmlUrl, XmlFile, GetUserAgentOsString());
      }
      try
      {
        doc.Load(XmlFile);
        XmlNode node = doc.SelectSingleNode("/Applications/" + session_id + "/" + node_id);
        return node.InnerText;
      }
      catch
      {
        MessageBox.Show(Localizer.GetBestTranslation("DownloadSettings_failed"), XmlUrl, MessageBoxButtons.OK,
                        MessageBoxIcon.Stop);
        File.Delete(XmlFile);
        Environment.Exit(-2);
      }
      return String.Empty;
    }