Beispiel #1
0
        public void Finish(AppWorkspace appWorkspace)
        {
            // Assumes we are running in the main UI thread

            if (this.finishing)
            {
                return;
            }

            try
            {
                if (this.haveFinished)
                {
                    throw new ApplicationException("already called Finish()");
                }

                this.finishing = true;
                this.haveFinished = true;

                // Verify the update's signature
                bool verified = Security.VerifySignedFile(StateMachine.UIContext, this.installerPath, true, false);
                CloseAllWorkspacesAction cawa = new CloseAllWorkspacesAction();
                appWorkspace.PerformAction(cawa);

                if (verified && !cawa.Cancelled)
                {
                    // we're in the clear, launch the update!
                    Settings.CurrentUser.SetString(PdnSettings.UpdateMsiFileName, this.installerPath);

                    if (0 == string.Compare(Path.GetExtension(this.installerPath), ".exe", true))
                    {
                        const string arguments = "/skipConfig";
                        Shell.Execute(appWorkspace, this.installerPath, arguments, true, Shell.ExecuteWaitType.RelaunchPdnOnExit);
                        Startup.CloseApplication();
                    }
                    else
                    {
                    }
                }
                else
                {
                    try
                    {
                        File.Delete(this.installerPath);
                    }

                    catch (Exception)
                    {
                    }
                }
            }

            finally
            {
                this.finishing = false;
            }
        }
        public void Finish(AppWorkspace appWorkspace)
        {
            // Assumes we are running in the main UI thread

            if (this.finishing)
            {
                return;
            }

            try
            {
                if (this.haveFinished)
                {
                    throw new ApplicationException("already called Finish()");
                }

                this.finishing    = true;
                this.haveFinished = true;

                // Verify the update's signature
                bool verified = Security.VerifySignedFile(StateMachine.UIContext, this.installerPath, true, false);
                CloseAllWorkspacesAction cawa = new CloseAllWorkspacesAction();
                appWorkspace.PerformAction(cawa);

                if (verified && !cawa.Cancelled)
                {
                    // we're in the clear, launch the update!
                    Settings.CurrentUser.SetString(PdnSettings.UpdateMsiFileName, this.installerPath);

                    if (0 == string.Compare(Path.GetExtension(this.installerPath), ".exe", true))
                    {
                        const string arguments = "/skipConfig";
                        Shell.Execute(appWorkspace, this.installerPath, arguments, true, Shell.ExecuteWaitType.RelaunchPdnOnExit);
                        Startup.CloseApplication();
                    }
                    else
                    {
                    }
                }
                else
                {
                    try
                    {
                        File.Delete(this.installerPath);
                    }

                    catch (Exception)
                    {
                    }
                }
            }

            finally
            {
                this.finishing = false;
            }
        }
Beispiel #3
0
 private void MenuHelpSendFeedback_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new SendFeedbackAction());
 }
Beispiel #4
0
 private void ClearList_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new ClearMruListAction());
 }
Beispiel #5
0
 private void MenuFileAcquireFromScannerOrCamera_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new AcquireFromScannerOrCameraAction());
 }
Beispiel #6
0
 private void MenuFileNew_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new NewImageAction());
 }
Beispiel #7
0
 private void MenuFileOpen_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new OpenFileAction());
 }
Beispiel #8
0
 private void MenuEditPasteInToNewImage_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new PasteInToNewImageAction());
 }