Esempio n. 1
0
        private NewFeedWizard(IOpenPgp openPgp)
        {
            InitializeComponent();

            // Pages
            var downloadPage              = new DownloadPage(_feedBuilder, _installerCapture);
            var archiveExtractPage        = new ArchiveExtractPage(_feedBuilder);
            var entryPointPage            = new EntryPointPage(_feedBuilder);
            var installerCaptureStartPage = new InstallerCaptureStartPage(_installerCapture, _feedBuilder);
            var installerCaptureDiffPage  = new InstallerCaptureDiffPage(_installerCapture, _feedBuilder);
            var installerCollectFilesPage = new InstallerCollectFilesPage(_installerCapture);
            var installerAltDownloadPage  = new DownloadPage(_feedBuilder, _installerCapture);
            var installerExtractPage      = new ArchiveExtractPage(_feedBuilder, _installerCapture);
            var installerEntryPointPage   = new EntryPointPage(_feedBuilder);
            var detailsPage  = new DetailsPage(_feedBuilder);
            var iconPage     = new IconPage(_feedBuilder);
            var securityPage = new SecurityPage(_feedBuilder, openPgp);
            var donePage     = new DonePage();

            // Flows
            downloadPage.AsArchive    += () => PushPage(archiveExtractPage);
            downloadPage.AsSingleFile += () =>
            {
                _feedBuilder.GenerateCommands();
                PushPage(detailsPage);
            };
            downloadPage.AsInstaller += () => PushPage(installerCaptureStartPage);
            archiveExtractPage.Next  += () => PushPage(entryPointPage);
            entryPointPage.Next      += () =>
            {
                _feedBuilder.GenerateCommands();
                PushPage(detailsPage);
            };
            installerCaptureStartPage.Next            += () => PushPage(installerCaptureDiffPage);
            installerCaptureStartPage.Skip            += () => PushPage(archiveExtractPage);
            installerCaptureDiffPage.AsArchive        += () => PushPage(installerExtractPage);
            installerCaptureDiffPage.AltSource        += () => PushPage(installerCollectFilesPage);
            installerCollectFilesPage.Next            += () => PushPage(installerEntryPointPage);
            installerCollectFilesPage.ExistingArchive += () => PushPage(installerAltDownloadPage);
            installerAltDownloadPage.AsArchive        += () => PushPage(installerExtractPage);
            installerExtractPage.Next    += () => PushPage(installerEntryPointPage);
            installerEntryPointPage.Next += () =>
            {
                _installerCapture.CaptureSession.Finish();
                PushPage(detailsPage);
            };
            detailsPage.Next  += () => PushPage(iconPage);
            iconPage.Next     += () => PushPage(securityPage);
            securityPage.Next += () => PushPage(donePage);
            donePage.Finish   += () =>
            {
                _signedFeed = _feedBuilder.Build();
                Close();
            };

            // Start
            PushPage(downloadPage);
        }
Esempio n. 2
0
        /// <summary>
        /// Finishes the capture process after <see cref="Diff"/> has been called an <see cref="FeedBuilder.MainCandidate"/> has been set.
        /// </summary>
        /// <exception cref="InvalidOperationException"><see cref="Diff"/> was not called or <see cref="FeedBuilder.MainCandidate"/> is not set.</exception>
        /// <exception cref="IOException">There was an error accessing the registry or file system.</exception>
        /// <exception cref="UnauthorizedAccessException">Access to the registry or file system was not permitted.</exception>
        public void Finish()
        {
            if (_diff == null || InstallationDir == null)
            {
                throw new InvalidOperationException("Diff() must be called first.");
            }

            _feedBuilder.GenerateCommands();

            var commandMapper = new CommandMapper(InstallationDir, _feedBuilder.Commands);

            _feedBuilder.CapabilityList = GetCapabilityList(commandMapper, _diff);
        }
Esempio n. 3
0
 private void OnSingleFile()
 {
     Retrieve(
         new SingleFile {
         Href = textBoxDownloadUrl.Uri
     },
         checkLocalCopy.Checked ? textBoxLocalPath.Text : null);
     _feedBuilder.ImplementationDirectory = _feedBuilder.TemporaryDirectory;
     using (var handler = new DialogTaskHandler(this))
     {
         _feedBuilder.DetectCandidates(handler);
         _feedBuilder.CalculateDigest(handler);
     }
     if (_feedBuilder.MainCandidate == null)
     {
         throw new NotSupportedException(Resources.NoEntryPointsFound);
     }
     else
     {
         _feedBuilder.GenerateCommands();
         pageDownload.NextPage = pageDetails;
     }
 }