protected override async Task ExecuteAsync(IPackage package, CancellationToken cancellationToken) { IPackageContent packageContent = await package.GetContentAsync(cancellationToken); await packageContent.RemoveFromAsync(service.Path, cancellationToken); await packageContent.ExtractToAsync(service.Path, cancellationToken); }
protected override async Task ExecuteAsync(IPackage package, CancellationToken cancellationToken) { IPackageContent packageContent = await package.GetContentAsync(cancellationToken); string pluginPath = Path.Combine(service.Path, package.Id); await packageContent.RemoveFromAsync(pluginPath, cancellationToken); await packageContent.ExtractToAsync(pluginPath, cancellationToken); }
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(); }