Пример #1
0
        public async Task Execute(AppGetOption commandOptions)
        {
            var installOptions = (InstallOptions)commandOptions;

            var package = await _packageRepository.GetAsync(installOptions.PackageId, installOptions.Tag);

            await _installService.Install(package, installOptions.GetInteractivityLevel());
        }
Пример #2
0
        public void Install()
        {
            install.Install(package.Object);

            Reader(reader =>
            {
                Assert.IsTrue(reader.GetPackages().Any(p => p.PackageIdentity.Id == package.Object.Id && p.PackageIdentity.Version.ToFullString() == package.Object.Version));
            });
        }
        public void Install()
        {
            install.Install(package.Object);

            Reader(reader =>
            {
                Assert.IsTrue(reader.GetPackages().Any(p => string.Equals(p.PackageIdentity.Id, package.Object.Id, StringComparison.CurrentCultureIgnoreCase) && string.Equals(p.PackageIdentity.Version.ToFullString(), package.Object.Version, StringComparison.CurrentCultureIgnoreCase)));
            });
        }
Пример #4
0
        protected override async Task ExecuteAsync(IPackage package, CancellationToken cancellationToken)
        {
            bool execute = true;

            if (Executing != null)
            {
                execute = await Executing();
            }

            if (execute)
            {
                IPackageContent packageContent = await package.GetContentAsync(cancellationToken);

                await packageContent.ExtractToAsync(service.Path, cancellationToken);

                service.Install(package);
            }

            Completed?.Invoke();
        }
        protected override async Task ExecuteAsync(IPackage package, CancellationToken cancellationToken)
        {
            bool execute = true;

            if (Executing != null)
            {
                execute = await Executing();
            }

            if (execute)
            {
                IPackageContent packageContent = await package.GetContentAsync(cancellationToken);

                string pluginPath = Path.Combine(service.Path, package.Id);
                Directory.CreateDirectory(pluginPath);
                await packageContent.ExtractToAsync(pluginPath, cancellationToken);

                service.Install(package);
            }

            Completed?.Invoke();
        }
        protected override async Task ExecuteAsync(PackageUpdateViewModel package, CancellationToken cancellationToken)
        {
            bool execute = true;

            if (Executing != null)
            {
                execute = await Executing();
            }

            if (execute)
            {
                if (package.IsSelf && !selfUpdate.IsSelfUpdate)
                {
                    selfUpdate.Update(package.Target);
                    return;
                }

                IPackageContent packageContent = await package.Current.Model.GetContentAsync(cancellationToken);

                string pluginPath = Path.Combine(install.Path, package.Current.Id);
                await packageContent.RemoveFromAsync(pluginPath, cancellationToken);

                install.Uninstall(package.Current.Model);

                packageContent = await package.Target.GetContentAsync(cancellationToken);

                await packageContent.ExtractToAsync(pluginPath, cancellationToken);

                install.Install(package.Target);

                if (package.IsSelf)
                {
                    selfUpdate.RunNewInstance(package.Target);
                }
            }

            Completed?.Invoke();
        }
Пример #7
0
        public async Task UpdatePackage(string packageId, string tag, InstallInteractivityLevel interactivityLevel)
        {
            var manifest = await _packageRepository.GetAsync(packageId, tag);

            await _installService.Install(manifest, interactivityLevel);
        }