예제 #1
0
        private static void Install()
        {
            InstallerWorker installer = new InstallerWorker();

            installer.OnError    += installer_OnError;
            installer.OnComplete += installer_OnComplete;
            installer.Install();
        }
예제 #2
0
        private void timer_Tick(object sender, EventArgs e)
        {
            DispatcherTimer timer = (DispatcherTimer)sender;

            timer.Stop();
            timer.Tick -= timer_Tick;
            timer       = null;

            if (InstallerData.InstalledVersion != null &&
                InstallerData.BackwardsCompatibleTo >= InstallerData.InstalledVersion)
            {
                TaskDialog td = new TaskDialog(Window.GetWindow(this),
                                               "Version conflict",
                                               "This version of " + InstallerData.DisplayName + " is not compatible with the currently installed version. The old version will be completely uninstalled, and you will lose any cloud accounts, appointments, contacts, tasks, notes, or custom dictionaries that you may have saved.",
                                               MessageType.Exclamation, true);

                if (td.ShowDialog() == true)
                {
                    InstallerWorker installer = new InstallerWorker();
                    installer.OnProgress += installer_OnProgress;
                    installer.OnError    += installer_OnError;
                    installer.OnComplete += installer_OnComplete;
                    installer.Install();
                }
                else
                {
                    CancelSetup(null);
                }
            }
            else
            {
                InstallerWorker installer = new InstallerWorker();
                installer.OnProgress += installer_OnProgress;
                installer.OnError    += installer_OnError;
                installer.OnComplete += installer_OnComplete;
                installer.Install();
            }
        }