Example #1
0
        /// <summary>
        /// Check for update
        /// </summary>
        public static bool AutoUpdate()
        {
            // Issue #520: intercept any possible exception and fail quietly
            try
            {
                Directory.CreateDirectory(App.ConfigDir(Dir.Temporary));

                var updateXML = App.ConfigDir(Dir.Temporary, "update.xml");
                var up        = new Update(new Uri("https://imageglass.org/checkforupdate"), updateXML);

                if (File.Exists(updateXML))
                {
                    File.Delete(updateXML);
                }

                if (!up.IsError &&
                    up.CheckForUpdate(App.StartUpDir("ImageGlass.exe")) &&
                    up.Info.VersionType.ToLower() == "stable")
                {
                    using (var f = new frmCheckForUpdate())
                    {
                        f.ShowDialog();
                    }
                }
            }
            catch { }


            return(Configs.IsNewVersionAvailable);
        }
Example #2
0
        /// <summary>
        /// Check for update
        /// </summary>
        public static void AutoUpdate()
        {
            // Issue #520: intercept any possible exception and fail quietly
            try
            {
                Directory.CreateDirectory(GlobalSetting.ConfigDir(Dir.Temporary));

                string updateXML = GlobalSetting.ConfigDir(Dir.Temporary, "update.xml");
                Update up        = new Update(new Uri("https://imageglass.org/checkforupdate"), updateXML);

                if (File.Exists(updateXML))
                {
                    File.Delete(updateXML);
                }

                if (!up.IsError &&
                    up.CheckForUpdate(GlobalSetting.StartUpDir("ImageGlass.exe")) &&
                    up.Info.VersionType.ToLower() == "stable")
                {
                    frmCheckForUpdate f = new frmCheckForUpdate();
                    f.ShowDialog();
                }
            }
            catch (Exception e)
            {
            }

            Application.Exit();
        }
Example #3
0
        /// <summary>
        /// Check for update
        /// </summary>
        public static void AutoUpdate()
        {
            string updateXML = Path.Combine(GlobalSetting.StartUpDir, "update.xml");
            Update up        = new Update(new Uri("http://www.imageglass.org/checkforupdate"), updateXML);

            if (File.Exists(updateXML))
            {
                File.Delete(updateXML);
            }

            if (!up.IsError &&
                up.CheckForUpdate(Path.Combine(GlobalSetting.StartUpDir, "ImageGlass.exe")) &&
                up.Info.VersionType.ToLower() == "stable")
            {
                frmCheckForUpdate f = new frmCheckForUpdate();
                f.ShowDialog();
            }

            Application.Exit();
        }
Example #4
0
        /// <summary>
        /// Check for update
        /// </summary>
        public static void AutoUpdate()
        {
            Update up = new Update(new Uri("http://www.imageglass.org/checkforupdate"),
                                   GlobalSetting.StartUpDir + "update.xml");

            if (File.Exists(GlobalSetting.StartUpDir + "update.xml"))
            {
                File.Delete(GlobalSetting.StartUpDir + "update.xml");
            }

            //save last update
            GlobalSetting.SetConfig("AutoUpdate", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));

            if (up.CheckForUpdate(Application.StartupPath + "\\ImageGlass.exe") &&
                up.Info.VersionType.ToLower() == "stable")
            {
                frmCheckForUpdate f = new frmCheckForUpdate();
                f.ShowDialog();
            }

            Application.Exit();
        }
Example #5
0
        /// <summary>
        /// Check for update
        /// </summary>
        public static void AutoUpdate()
        {
            Update up = new Update(new Uri("http://www.imageglass.org/checkforupdate"),
                GlobalSetting.StartUpDir + "update.xml");

            if (File.Exists(GlobalSetting.StartUpDir + "update.xml"))
            {
                File.Delete(GlobalSetting.StartUpDir + "update.xml");
            }

            //save last update
            GlobalSetting.SetConfig("AutoUpdate", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));

            if (up.CheckForUpdate(Application.StartupPath + "\\ImageGlass.exe") &&
                up.Info.VersionType.ToLower() == "stable")
            {
                frmCheckForUpdate f = new frmCheckForUpdate();
                f.ShowDialog();
            }

            Application.Exit();
        }