예제 #1
0
 public DeltaPatchAction(DirectoryPatcher directoryPatcher, string subPath, string patchSubPath, long patchSize, string hash)
 {
     DirectoryPatcher = directoryPatcher;
     SubPath          = subPath;
     PatchSubPath     = patchSubPath;
     Hash             = hash;
     PatchSize        = patchSize;
 }
예제 #2
0
 public FullReplaceAction(DirectoryPatcher directoryPatcher, string subPath, string patchSubPath, bool needsBackup, long patchSize, string hash)
 {
     DirectoryPatcher = directoryPatcher;
     SubPath          = subPath;
     PatchSubPath     = patchSubPath;
     NeedsBackup      = needsBackup;
     Hash             = hash;
     PatchSize        = patchSize;
 }
예제 #3
0
        public async Task ApplyPatchFromFilesystem(string patchPath, string targetPath, string applicationDirPath, IProgress <DirectoryPatcherProgressReport> progress, CancellationToken cancellationToken, string instructionsHash)
        {
            var backupPath = CreateBackupPath(applicationDirPath);
            var tempPath   = CreateTempPath(applicationDirPath);

            var patchSource = new FileSystemPatchSource(patchPath);
            var patcher     = new DirectoryPatcher(new XdeltaPatcher(XdeltaPatchSystemFactory.Preferred), targetPath, backupPath, tempPath, patchSource);
            await patcher.ApplyPatchAsync(progress, cancellationToken, instructionsHash);
        }
예제 #4
0
        public async Task ApplyPatchFromWebDownloadTask(UpdateServerEntry baseUrl, string targetPath, string applicationDirPath, IProgress <DirectoryPatcherProgressReport> progress, CancellationToken cancellationToken, string instructionsHash)
        {
            UpdateServer = baseUrl;

            var backupPath   = CreateBackupPath(applicationDirPath);
            var downloadPath = CreateDownloadPath(applicationDirPath);
            var tempPath     = CreateTempPath(applicationDirPath);

            using (var patchSource = new WebPatchSource(this, downloadPath))
            {
                var patcher = new DirectoryPatcher(new XdeltaPatcher(XdeltaPatchSystemFactory.Preferred), targetPath, backupPath, tempPath, patchSource);
                await patcher.ApplyPatchAsync(progress, cancellationToken, instructionsHash);

                DirectoryEx.DeleteContents(downloadPath);
                DirectoryEx.DeleteContents(tempPath);

                // delete backup?
            }
        }
예제 #5
0
 public RemoveAction(DirectoryPatcher directoryPatcher, string subPath, bool needsBackup)
 {
     DirectoryPatcher = directoryPatcher;
     SubPath          = subPath;
     NeedsBackup      = needsBackup;
 }
예제 #6
0
 public ModifiedTimeReplaceAction(DirectoryPatcher directoryPatcher, string subPath, DateTime lastWriteTime)
 {
     DirectoryPatcher = directoryPatcher;
     SubPath          = subPath;
     LastWriteTime    = lastWriteTime;
 }