Example #1
0
 public void Cancel()
 {
     if (ModernDialogService.Show(Properties.Resources.NotCompleted, ApplicationTitle,
                                  MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         CurrentWindowService.Close();
     }
 }
Example #2
0
        public async Task GoNext()
        {
            if (Pages.CurrentPosition == 0)
            {
                string previousSetupLocation = Utilities.GetPreviousSetupLocation(ApplicationTitle);
                if (!String.IsNullOrEmpty(previousSetupLocation) && Directory.Exists(previousSetupLocation))
                {
                    SetupLocation = previousSetupLocation;
                }
                else
                {
                    SetupLocation = DefaultSetupLocation;
                }

                CreateShortcut    = true;
                LaunchApplication = true;

                ArchiveSize   = CalculateArchiveSize();
                SpaceRequired = ArchiveSize / MB;
            }
            else if (Pages.CurrentPosition == 3)
            {
                if (Utilities.CheckRunningApplication(ProductName))
                {
                    ModernDialogService.Show(String.Format(Properties.Resources.AlreadyRunning, ApplicationTitle), ApplicationTitle,
                                             MessageBoxButton.OK, MessageBoxImage.Information);

                    if (!Utilities.CloseRunningApplication(ProductName))
                    {
                        ModernDialogService.Show(String.Format(Properties.Resources.StillRunning, ApplicationTitle), ApplicationTitle,
                                                 MessageBoxButton.OK, MessageBoxImage.Error);

                        return;
                    }
                }

                await ExtractArchive();

                Cleanup();

                if (CreateShortcut)
                {
                    Utilities.CreateShortcut(SetupLocation, ProductName, ApplicationTitle, ApplicationDescription);
                }
            }

            Pages.MoveCurrentToNext();
        }
Example #3
0
        public void Finish()
        {
            if (LaunchApplication)
            {
                try
                {
                    Process.Start(Path.Combine(SetupLocation, ProductName + ".exe"));
                }
                catch (Exception e)
                {
                    ModernDialogService.Show(e.Message, ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }

            Utilities.SetCurrentSetupLocation(SetupLocation, ApplicationTitle);
            CurrentWindowService.Close();
        }