/// <exception cref = "FormatException">projectName contains invalid character(s)</exception> private PatchResult CreatePatch() { versionInfo = new VersionInfo() { Name = projectName, // throws FormatException if 'projectName' contains invalid character(s) Version = version, BaseDownloadURL = baseDownloadURL, MaintenanceCheckURL = maintenanceCheckURL, CompressionFormat = compressionFormatRepairPatch }; PatchUtils.DeleteDirectory(outputPath); Directory.CreateDirectory(outputPath); if (cancel) { return(PatchResult.Failed); } Log(Localization.Get(StringId.GeneratingListOfFilesInBuild)); AddFilesToVersionRecursively(new DirectoryInfo(rootPath), ""); if (cancel) { return(PatchResult.Failed); } if (generateRepairPatch && CreateRepairPatch() == PatchResult.Failed) { return(PatchResult.Failed); } if (generateInstallerPatch && CreateInstallerPatch() == PatchResult.Failed) { return(PatchResult.Failed); } if (GenerateIncrementalPatch && CreateIncrementalPatch() == PatchResult.Failed) { return(PatchResult.Failed); } PatchUtils.SetVersion(rootPath, projectName, version); versionInfo.IgnoredPaths.AddRange(ignoredPaths); Log(Localization.Get(StringId.WritingVersionInfoToXML)); PatchUtils.SerializeVersionInfoToXML(versionInfo, outputPath + PatchParameters.VERSION_INFO_FILENAME); Log(Localization.Get(StringId.Done)); return(PatchResult.Success); }
/// <exception cref = "FormatException">projectName contains invalid character(s)</exception> private PatchResult CreatePatch() { patch = new VersionInfo() { Name = projectName, // throws FormatException if 'projectName' contains invalid character(s) Version = version }; PatchUtils.DeleteDirectory(outputPath); Directory.CreateDirectory(outputPath); if (cancel) { return(PatchResult.Failed); } Log(Localization.Get(StringId.GeneratingListOfFilesInBuild)); CreateFileList(); if (cancel) { return(PatchResult.Failed); } if (generateRepairPatch && CreateRepairPatch() == PatchResult.Failed) { return(PatchResult.Failed); } if (GenerateIncrementalPatch && CreateIncrementalPatch() == PatchResult.Failed) { return(PatchResult.Failed); } PatchUtils.SetVersion(rootPath, projectName, version); patch.IgnoredPaths.AddRange(ignoredPaths); Log(Localization.Get(StringId.WritingVersionInfoToXML)); PatchUtils.SerializeVersionInfoToXML(patch, outputPath + PatchParameters.VERSION_INFO_FILENAME); Log(Localization.Get(StringId.Done)); return(PatchResult.Success); }
public void UpdateVersion(VersionCode version) { PatchUtils.SetVersion(SelfPatching ? DecompressedFilesPath : RootPath, VersionInfo.Name, version); }
/// <exception cref = "FormatException">projectName contains invalid character(s)</exception> private PatchResult CreatePatch() { versionInfo = new VersionInfo() { Name = projectName, // throws FormatException if 'projectName' contains invalid character(s) Version = version, BaseDownloadURL = baseDownloadURL, MaintenanceCheckURL = maintenanceCheckURL, CompressionFormat = compressionFormatRepairPatch }; PatchUtils.DeleteDirectory(outputPath); Directory.CreateDirectory(outputPath); // Preserve previous incremental patch info if (previousVersionInfo != null) { versionInfo.IncrementalPatches.AddRange(previousVersionInfo.IncrementalPatches); if (!dontCreatePatchFilesForUnchangedFiles) { string previousIncrementalPatches = previousPatchFilesRoot + PatchParameters.INCREMENTAL_PATCH_DIRECTORY + Path.DirectorySeparatorChar; if (Directory.Exists(previousIncrementalPatches)) { PatchUtils.CopyDirectory(previousIncrementalPatches, incrementalPatchOutputPath); } } } if (cancel) { return(PatchResult.Failed); } Log(Localization.Get(StringId.GeneratingListOfFilesInBuild)); AddFilesToVersionRecursively(new DirectoryInfo(rootPath), ""); if (cancel) { return(PatchResult.Failed); } if (generateRepairPatch && CreateRepairPatch() == PatchResult.Failed) { return(PatchResult.Failed); } if (generateInstallerPatch && CreateInstallerPatch() == PatchResult.Failed) { return(PatchResult.Failed); } if (GenerateIncrementalPatch && CreateIncrementalPatch() == PatchResult.Failed) { return(PatchResult.Failed); } PatchUtils.SetVersion(rootPath, projectName, version); versionInfo.IgnoredPaths.AddRange(ignoredPaths); Log(Localization.Get(StringId.WritingVersionInfoToXML)); PatchUtils.SerializeVersionInfoToXML(versionInfo, outputPath + PatchParameters.VERSION_INFO_FILENAME); Log(Localization.Get(StringId.Done)); return(PatchResult.Success); }