Пример #1
0
        public AppUpdater(IHostApplicationLifetime applicationLifetime, IOptions <PrintSpoolerOptions> options, ILogger <AppUpdater> logger)
        {
            _applicationLifetime = applicationLifetime;
            _options             = options.Value;
            _logger = logger;

            IPackageResolver resolver;

            if (_options.LocalPackageRepository is object)
            {
                resolver = new LocalPackageResolver(_options.LocalPackageRepository);
            }
            else
            {
                resolver = new GithubPackageResolver("rmja", "Cloudspool", "PrintSpooler-win64.zip");
            }

            var entryAssembly = AssemblyMetadata.FromEntryAssembly();

            var updateeName = _options.UpdateeName ?? entryAssembly.Name;
            var updatee     = new AssemblyMetadata(updateeName, entryAssembly.Version, entryAssembly.FilePath);

            _um = new UpdateManager(
                updatee,
                resolver,
                new ZipPackageExtractor());
        }
Пример #2
0
 /// <summary>
 /// Initializes an instance of <see cref="UpdateManager"/> on the entry assembly.
 /// </summary>
 public UpdateManager(IPackageResolver resolver, IPackageExtractor extractor)
     : this(AssemblyMetadata.FromEntryAssembly(), resolver, extractor)
 {
 }