//  Constructors
        //  ============

        /// <exception cref="System.Security.SecurityException">Ignore.</exception>
        public UpdateDownloading(UpdateWindow parent)
        {
            this.parent      = parent;
            downloadFolder   = Path.Combine(Path.GetTempPath(), "Kallithea Klone");
            downloadLocation = Path.Combine(downloadFolder, "Update.msi");

            InitializeComponent();
        }
Ejemplo n.º 2
0
        public void PromptUpdate(IRestResponse response)
        {
            if (response.StatusCode != HttpStatusCode.OK)
            {
                return;
            }

            GithubRelease release = JsonConvert.DeserializeObject <GithubRelease>(response.Content);

            if (release == null)
            {
                return;
            }

            if (release.IsDraft)
            {
                return;
            }

            Version.TryParse(release.Tag.Split('-')[0].Replace("v", ""), out Version version);

            if (Assembly.GetExecutingAssembly().GetName().Version.CompareTo(version) >= 0)
            {
                return;
            }

            Asset asset = release.Assets.FirstOrDefault(r => r.URL.EndsWith(".msi"));

            if (asset == null)
            {
                return;
            }

            UpdateWindow prompt = new UpdateWindow(release.URL, asset.URL)
            {
                Owner = this
            };

            prompt.ShowDialog();
        }
Ejemplo n.º 3
0
        //  Constructors
        //  ============

        public UpdateFound(UpdateWindow parent)
        {
            this.parent = parent;

            InitializeComponent();
        }