private async Task RunIsValidReleaseEntryTest(InvalidReleaseEntry invalidReleaseEntry, bool createFile, bool onlyCheckFail = false) { var releaseFile = await DummyReleaseEntry.MakeDummyReleaseEntry(createFile, ".tuup"); Assert.IsTrue(releaseFile.IsValidReleaseEntry(SemanticVersion.BaseVersion(), createFile), "ReleaseEntry checking failed when we should of passed"); if (!onlyCheckFail) { releaseFile = await DummyReleaseEntry.MakeDummyReleaseEntry(createFile, ".tuup", invalidReleaseOptions : invalidReleaseEntry); Assert.IsFalse(releaseFile.IsValidReleaseEntry(SemanticVersion.BaseVersion(), createFile), "ReleaseEntry checking passed when we should of failed"); } }
public ApplicationMetadata() { //Get the assembly if possible and get data out of it var runningAssembly = Assembly.GetEntryAssembly(); if (runningAssembly == null) { _logging.Warning("Can't get running assembly, will not have any metadata to work with!"); return; } var applicationName = runningAssembly.GetName(); ApplicationVersion = runningAssembly.GetSemanticVersion() ?? SemanticVersion.BaseVersion(); ApplicationName = applicationName.Name !; var folder = runningAssembly.Location; folder = folder[..folder.LastIndexOf(Path.DirectorySeparatorChar)];
public void CreateDeltaPackage() { var applicationMetadata = new ApplicationMetadata(); applicationMetadata.ApplicationFolder = @"C:\Users\aaron\AppData\Local\osulazer"; applicationMetadata.ApplicationVersion = SemanticVersion.Parse("2021.129.0"); //Apply update var wasSuccessful = _updateCreator.CreateDeltaPackage(applicationMetadata, @"C:\Users\aaron\AppData\Local\osulazer\app-2021.302.0", SemanticVersion.Parse("2021.226.0"), @"C:\Users\aaron\AppData\Local\osulazer\app-2021.226.0", SemanticVersion.BaseVersion(), null, @"C:\Users\aaron\AppData\Local\osulazer", progress: obj => _logger.Debug($"Progress: {obj * 100}")); Assert.True(wasSuccessful, "Wasn't able to apply update"); }