public IUninstallCommand CreateUninstallCommand(AppUpdaterContext context)
 {
     return(new UninstallCommand(context.App.LocalDirectory, context.App.LocalMetaData));
 }
        public IDownloadPackageCommand CreateDownloadDiffPackageCommand(int versionId, string keySecret,
                                                                        string countryCode, AppUpdaterContext context, CancellationToken cancellationToken)
        {
            var resource = context.App.RemoteData.GetDiffPackageResource(versionId, keySecret, countryCode, cancellationToken);

            var    appDownloadDirectory = context.App.DownloadDirectory;
            var    destinationFilePath  = appDownloadDirectory.GetDiffPackagePath(versionId);
            string destinationMetaPath  = appDownloadDirectory.GetDiffPackageMetaPath(versionId);

            appDownloadDirectory.PrepareForWriting();

            return(new DownloadPackageCommand(resource, destinationFilePath, destinationMetaPath));
        }
        public ICheckVersionIntegrityCommand CreateCheckVersionIntegrityCommand(int versionId, AppUpdaterContext context,
                                                                                bool isCheckingHash, bool isCheckingSize, CancellationToken cancellationToken)
        {
            var versionContentSummary = context.App.RemoteMetaData.GetContentSummary(versionId, cancellationToken);

            return(new CheckVersionIntegrityCommand(versionId,
                                                    versionContentSummary,
                                                    context.App.LocalDirectory,
                                                    context.App.LocalMetaData,
                                                    isCheckingHash, isCheckingSize));
        }
        public ICheckDiskSpace CreateCheckDiskSpaceCommandForContent(int versionId, AppUpdaterContext context, CancellationToken cancellationToken)
        {
            AppContentSummary contentSummary = context.App.RemoteMetaData.GetContentSummary(versionId, cancellationToken);

            return(new CheckDiskSpaceCommand(contentSummary, context.App.LocalDirectory.Path));
        }