Skip to content

Commit

Permalink
0.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rayenghanmi committed Dec 4, 2024
1 parent 34a5e1d commit b21ce5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this branch will be documented in this file.

## 0.9.0 - Unreleased
## 0.9.0 - Released

### Added

Expand Down
17 changes: 11 additions & 6 deletions Views/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,19 @@ static string ExtractLatestVersionChanges(string changelog)
var match = Regex.Match(changelog, @"## (\d+\.\d+\.\d+) - Released\n((.|\n)*?)(?=\n## |$)");
if (match.Success)
{
return match.Groups[2].Value.Trim();
var latestChanges = match.Groups[2].Value.Trim();
latestChanges = Regex.Replace(latestChanges, @"^###\s+", "", RegexOptions.Multiline);
latestChanges = Regex.Replace(latestChanges, @"^>\s+", "", RegexOptions.Multiline);
latestChanges = Regex.Replace(latestChanges, @"\[\!(.*?)\]", match => match.Groups[1].Value);

return latestChanges;
}
else
{
return "No notable changes found.";
}
}

public async Task InstallRyTuneX(string downloadUrl)
{
var tempPath = Path.GetTempPath();
Expand All @@ -308,7 +314,7 @@ public async Task InstallRyTuneX(string downloadUrl)
UpdateProgress.Visibility = Visibility.Visible;
UpdateStatusText.Text = "Downloading...";

// Step 1: Download the ZIP file
// Download the ZIP file
using (var webClient = new WebClient())
{
await webClient.DownloadFileTaskAsync(new Uri(downloadUrl), zipFilePath);
Expand All @@ -322,10 +328,9 @@ public async Task InstallRyTuneX(string downloadUrl)
Debug.WriteLine("Changelog download complete.");
}

// Extract the latest version's changes
ApplicationData.Current.LocalSettings.Values["latestChanges"] = ExtractLatestVersionChanges(changelogContent);

// Step 2: Extract the ZIP file
// Extract the ZIP file
Debug.WriteLine("Extracting files...");
UpdateStatusText.Text = "Extracting...";
if (Directory.Exists(extractionPath))
Expand All @@ -335,15 +340,15 @@ public async Task InstallRyTuneX(string downloadUrl)
ZipFile.ExtractToDirectory(zipFilePath, extractionPath);
Debug.WriteLine("Extraction complete.");

// Step 3: Delete the ZIP file
// Delete the ZIP file
Debug.WriteLine("Cleaning up...");
if (File.Exists(zipFilePath))
{
File.Delete(zipFilePath);
Debug.WriteLine("Deleted RyTuneX.Setup.zip.");
}

// Step 4: Run the setup file with the --silent argument
// Run the setup file with the --silent argument
UpdateStatusText.Text = "Installing...";
Debug.WriteLine("Running RyTuneX Setup.exe...");
Process setupProcess = new Process
Expand Down

0 comments on commit b21ce5e

Please sign in to comment.