예제 #1
0
        public void Build()
        {
            if (DirectoriesManager.IsEmpty(_context.Settings.GetUpdaterFolderPath()))
            {
                throw new UpdaterFolderIsEmptyException();
            }

            _context.LogProgress(string.Format(_context.LocalizedMessages.UpdaterCollectingOldDefinition));
            var oldDefinition = GetCurrentDefinition();

            _context.LogProgress(string.Format(_context.LocalizedMessages.UpdaterCollectingFiles));
            var files = GetFiles();

            var definition = BuildDefinition(files, oldDefinition);

            FilesManager.Delete(_context.Settings.GetUpdaterIndexPath());

            FilesManager.Delete(_context.Settings.GetUpdaterDeployPath(_context.LauncherArchiveName));

            _context.LogProgress(string.Format(_context.LocalizedMessages.UpdaterCompressingArchive));
            Compressor.Compress(_context.Settings.GetUpdaterFolderPath(), _context.Settings.GetUpdaterDeployPath(_context.LauncherArchiveName), null, _context.CompressionLevel);
            _context.ReportProgress(string.Format(_context.LocalizedMessages.UpdaterCompressedArchive));

            File.WriteAllText(_context.Settings.GetUpdaterIndexPath(), _context.Serializer.Serialize(definition));
            _context.ReportProgress(string.Format(_context.LocalizedMessages.UpdaterSavedDefinition));
        }
예제 #2
0
 private bool ApplicationFolderIsEmpty()
 {
     return(DirectoriesManager.IsEmpty(_context.Settings.GetApplicationFolderPath()));
 }