Esempio n. 1
0
        private string GenerateArgsForUpdater(UpdateFiles Files, bool ExportIcon = true, bool UseUIXML = true)
        {
            List <string> Args = new List <string>();

            string uip = Path.GetTempFileName();

            ClientUpdater.DialogUI uid = new ClientUpdater.DialogUI();
            uid.AutoClose = false;

            ClientUpdater.DialogModule.InitInfo = uid;
            ClientUpdater.DialogModule.SaveXML(uip);
            Args.Add("\"UI:" + uip + "\"");

            if (ExportIcon)
            {
                string iconp = Path.GetTempFileName();

                FileStream fs     = new FileStream(iconp, FileMode.Open, FileAccess.Write);
                byte[]     buffer = ClientUpdater.DialogModule.IconToBytes(Properties.Resources.Limpid_Audio_Player);
                fs.Write(buffer, 0, buffer.Length);
                fs.Close();

                Args.Add("\"icon:" + iconp + "\"");
                Args.Add("\"rm:" + iconp + "\"");
            }

            if (UseUIXML)
            {
                string xml = Path.GetTempFileName();
                ClientUpdater.DialogUI ui = new ClientUpdater.DialogUI();
                ui.AutoClose = true;
            }

            Args.Add("\"Title:Limpid Audio Player\"");

            string file = "\"url:";

            for (int i = 0; Files.Files.Length > i; i++)
            {
                file += BaseURL + Files.Files[i] + ",";
                file += Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + @"\" + Path.GetFileName(Files.Files[i]);
                if (Files.Files.Length - 1 > i)
                {
                    file += ",";
                }
            }
            file += "\"";
            Args.Add(file);
            Args.Add("\"Boot:" + Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + @"\" + Files.Boot + "\"");
            Args.Add("\"Work:" + Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\"");

            Console.WriteLine(string.Join(" ", Args));
            return(string.Join(" ", Args));
        }
Esempio n. 2
0
        public UpdateFiles GetUpdateFiles()
        {
            string Value = NetworkTools.ReadString(new NetworkTools.PHP(GetAddressPHP,
                                                                        new NetworkTools.PHP.Argument[] { new NetworkTools.PHP.Argument(TitleName, DownloadValue) }));

            try
            {
                UpdateFiles   Files = null;
                XmlSerializer des   = new XmlSerializer(typeof(UpdateFiles));
                using (StringReader sr = new StringReader(NetworkTools.ReadString(Value)))
                {
                    Files = (UpdateFiles)des.Deserialize(sr);
                }

                return(Files);
            }
            catch (Exception) { return(null); }
        }