Beispiel #1
0
        private void LinkLabelNewVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // check if the NHM was installed
            var root        = new DirectoryInfo(Paths.Root);
            var isInstalled = false;

            foreach (var file in root.GetFiles("*.exe"))
            {
                if (file.Name == "Uninstall NiceHashMiner.exe")
                {
                    isInstalled = true;
                }
            }
            // end of installation checking
            if (!isInstalled)
            {
                ApplicationStateManager.VisitNewVersionUrl();
                return;
            }
            using (var updaterForm = new Form_ChooseUpdate())
            {
                SetChildFormCenter(updaterForm);
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Settings;
                updaterForm.ShowDialog();
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Main;
            }
        }
Beispiel #2
0
        private void LinkLabelNewVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var isInstalled = UpdateHelpers.IsNHMInstalled();

            if (!isInstalled)
            {
                ApplicationStateManager.VisitNewVersionUrl();
                return;
            }
            using (var updaterForm = new Form_ChooseUpdate())
            {
                SetChildFormCenter(updaterForm);
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Update;
                updaterForm.ShowDialog();
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Main;
            }
        }