Example #1
0
        public DialogResult SearchForUpdate()
        {
            MapInfo();

            try
            {
                XmlDocument xml = new XmlDocument();
                xml.Load(XmlUrl);

                XmlNode latestVersion = xml.SelectSingleNode("/Marlin3DprinterTool/Version");
                if (latestVersion != null)
                {
                    NewVersion = new Version(latestVersion.InnerText);
                }

                Version currentVersion = System.Reflection.Assembly.GetCallingAssembly().GetName().Version;

                if (currentVersion.CompareTo(NewVersion) < 0)
                {
                    FrmAutoUpdate autoUpdate = new FrmAutoUpdate
                    {
                        CurrentVersion = currentVersion,
                        NewVersion     = NewVersion,
                        XmlUrl         = XmlUrl
                    };
                    return(autoUpdate.ShowDialog());
                }
            }
            catch (Exception)
            {
                return(DialogResult.No);
            }
            return(DialogResult.No);
        }
Example #2
0
        public DialogResult ForceUpdate()
        {
            FrmAutoUpdate autoUpdate = new FrmAutoUpdate
            {
                CurrentVersion = CurrentVersion,
                NewVersion     = CurrentVersion,
                XmlUrl         = XmlUrl
            };

            return(autoUpdate.ShowDialog());
        }