Skip to content

Commit

Permalink
v1.5.0.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amakvana committed Mar 26, 2023
1 parent 3aa08e9 commit d996503
Show file tree
Hide file tree
Showing 21 changed files with 1,259 additions and 529 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file.

<br>

## [1.5.0.0] - 2023-03-26

### Added

- Added support for Early Access Builds via [pineappleEA](https://github.com/pineappleEA/pineapple-src)
- Mainline remains default for `New Install`, unless overridden.
- Ability to switch Update Channels for current installations.
- `Options` > `General` > `Update Channel` > `Override Update Channel`
- EzYuzu will automatically detect which Update Channel the seelcted copy of Yuzu is on.

### Changed

- Goodbye `RegEx`, hello `System.Text.Json`

- Completely refactored how EzYuzu pulls the latest archives down for both Update Channels - now uses api.github.com instead of downloading the entire webpage and parsing with RegEx. Increased robustness and further speed improvements.

- Updated `FrmAbout` credits to point to Readme Acknowledgements
- Updated `Ookii.Dialogs.WinForms` binaries from `1.2.0` to `4.0.0`
- Another code refactor to handle both Update Channels. Removed redundant code
- Improved yuzu version detection - checks current channel through `yuzu-cmd.exe`
- Further UI tweaks to improve UX
- Disabling dropdowns and other controls when `btnProcess` is initiated

### Fixed

- Improved error handling
- Typo's within `FrmAbout`

<br>

## [1.4.0.0] - 2022-12-30

### Added
Expand Down
26 changes: 18 additions & 8 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@

## Methodology

- Reads https://github.com/yuzu-emu/yuzu-mainline/releases/latest
- Fetches the latest .zip URL
- Reads [yuzu-mainline/releases/latest](https://github.com/yuzu-emu/yuzu-mainline/releases/latest) or [pineapple-src/releases/latest](https://github.com/pineappleEA/pineapple-src/releases/latest)
- Fetches the latest archive URL
- Downloads & extracts it into your Yuzu root folder

## Usage

1. Browse and locate the your Yuzu Root Folder, this is the folder containing `yuzu.exe`
2. EzYuzu will automatically detect the version of yuzu.exe
3. Click on `New Install` or `Update Yuzu`
3. (Optional): Change Update Channels
4. Click on `New Install` or `Update Yuzu`

- Downloads the latest copy of yuzu-mainline & extracts it into your Yuzu Root Folder.
- Automatically checks if your standalone copy of Yuzu is up-to-date.
- `Dependencies` can be included within `Update Yuzu` by checking the option within `Options` > `General` > `Update Yuzu` > `Reinstall Visual C++`
- Current `Update Channel` can be overridden by checking the option within within `Options` > `General` > `Update Channel` > `Override Update Channel`
- It shouldn't overwrite configs unless `New Install` is displayed. However, backup beforehand.
- Temp files are stored within `TempUpdate` and are deleted upon completion.

## Download Options

| Option | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `New Install` | Installs Yuzu & Redistributables. Resets configs & sets [optimised GPU defaults](https://github.com/amakvana/EzYuzu/tree/master/configs). |
| `Update Yuzu` | Updates Yuzu to the latest version, excluding Redistributables but excluding configs. |
| `Dependencies` | Includes Redistributables when `Update Yuzu` is triggered. |
| Option | Description |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `New Install` | Installs Yuzu Mainline & Redistributables. Resets configs & sets [optimised GPU defaults](https://github.com/amakvana/EzYuzu/tree/master/configs). |
| `Update Yuzu` | Updates Yuzu to the latest version, excluding Redistributables but excluding configs. |
| `Dependencies` | Includes Redistributables when `Update Yuzu` is triggered. |

## New Install

Expand All @@ -49,6 +51,14 @@ To install Yuzu Portable for the first time:
4. Click on `Update Yuzu`
5. Done

## Switching Update Channels

1. Select your Yuzu root folder (the folder containing `yuzu.exe`)
2. Check the `Override Update Channel` option within `Options` > `General` > `Update Channel`
3. Select which `Update Channel` you want to update Yuzu on, via the Dropdown menu.
4. Click on `Update Yuzu`
5. Done

## Checking Yuzu is up-to-date

1. Select your Yuzu root folder (the folder containing `yuzu.exe`)
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Portable Yuzu Updater for Standalone versions of Yuzu.

Perfect for those who run Yuzu off an External HDD or through (but not limited to) frontends such as LaunchBox, Steam, EmulationStation and HyperSpin.

![EzYuzu v1.4.0.0](images/ezyuzu_1400.png)
![EzYuzu v1.5.0.0](images/ezyuzu_1500.png)

## Table of Contents

Expand All @@ -33,7 +33,8 @@ Perfect for those who run Yuzu off an External HDD or through (but not limited t

1. Browse and locate the your Yuzu Root Folder, this is the folder containing `yuzu.exe`
2. EzYuzu will automatically detect the version of yuzu.exe
3. Click on `New Install` or `Update Yuzu`
3. (Optional): Change Update Channels
4. Click on `New Install` or `Update Yuzu`

- Downloads the latest copy of yuzu-mainline & extracts it into your Yuzu Root Folder.
- Automatically checks if your standalone copy of Yuzu is up-to-date.
Expand All @@ -47,13 +48,14 @@ Perfect for those who run Yuzu off an External HDD or through (but not limited t
https://github.com/amakvana/EzYuzu/releases/latest

Requires:

- Latest [7-Zip](https://www.7-zip.org/a/7z2201-x64.msi) installed.
- Latest [Microsoft .NET Framework](https://go.microsoft.com/fwlink/?linkid=2088631) installed.
- Latest [Visual C++ X64 Redistributable](https://aka.ms/vs/16/release/vc_redist.x64.exe) installed.

## Installation

Extract the entire contents of the EzYuzu.zip file into a folder and run EzYuzu.exe
Extract the entire contentsof the `EzYuzu.zip` file, including all `.dll` files, into a folder and run `EzYuzu.exe`

EzYuzu is 100% portable - it can be run from any location.

Expand All @@ -68,5 +70,6 @@ The User Guide can be found [here](https://github.com/amakvana/EzYuzu/blob/maste
Thanks:

- [Yuzu Team](https://yuzu-emu.org/) - Nintendo Switch Emulator Developers
- [PineappleEA](https://github.com/pineappleEA/pineapple-src) - Early Access Builds
- [Stellar](https://github.com/StellarUpdater/Stellar) - Inspiration
- [Agus Raharjo](https://www.iconfinder.com/agusraharj) - Icons
Binary file added images/ezyuzu_1500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions source/EzYuzu/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EzYuzu.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
Expand All @@ -16,4 +16,16 @@
</setting>
</EzYuzu.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
2 changes: 2 additions & 0 deletions source/EzYuzu/Classes/DirectoryUtilities.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace EzYuzu
{
Expand All @@ -10,6 +11,7 @@ public static void Copy(string fromFolder, string toFolder, bool overwrite = fal
{
Directory
.EnumerateFiles(fromFolder, "*.*", SearchOption.AllDirectories)
.Where(file => (File.GetAttributes(file) & (FileAttributes.Hidden | FileAttributes.System)) == 0)
.AsParallel()
.ForAll(from =>
{
Expand Down
94 changes: 94 additions & 0 deletions source/EzYuzu/Classes/EarlyAccessYuzuManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

namespace EzYuzu
{
public sealed class EarlyAccessYuzuManager : YuzuManager
{
private const string EarlyAccessYuzuRepoJsonUrl = "https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest";
private const string Quote = "\"";

public EarlyAccessYuzuManager() : base() { }

public new async Task ProcessYuzuNewInstallationAsync()
{
// prepare folders and pull configs
await base.ProcessYuzuNewInstallationAsync();

// pull latest copy of Yuzu
await this.ProcessYuzuUpdateAsync();
}

public new async Task DownloadInstallVisualCppRedistAsync()
{
await base.DownloadInstallVisualCppRedistAsync();
}

public async Task ProcessYuzuUpdateAsync()
{
Repo repoData = await GetEarlyAccessGitHubRepoJsonData();

string tagName = repoData.TagName;
string versionNumber = tagName.Substring(tagName.LastIndexOf("-") + 1).Trim();

// loop through the assets, find the .zip asset and process it
foreach (var asset in repoData?.Assets)
{
if (!asset.BrowserDownloadUrl.EndsWith(".zip", StringComparison.Ordinal))
continue;

// process latest version of EA Yuzu
using var client = new WebClient();
client.DownloadFileCompleted += (s, e) =>
{
// unpack
base.RaiseUpdateProgressDelegate(0, $@"Unpacking Yuzu Early Access {versionNumber} ...");

// unzip downloaded zip using 7zip
var psi = new ProcessStartInfo
{
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
FileName = base.SevenZipExeFilePath,
Arguments = $@"x {Quote}{Path.Combine(TempUpdateDirectoryPath, "yuzu.zip")}{Quote} -o{Quote}{YuzuDirectoryPath}{Quote} -aoa"
};
using (var p = Process.Start(psi))
{
p.WaitForExit();
}

// move archive contents from yuzu-windows-msvc-early-access into YuzuDirectoryPath
DirectoryUtilities.Copy(Path.Combine(YuzuDirectoryPath, "yuzu-windows-msvc-early-access"), YuzuDirectoryPath, true);

// update version number
var filePath = Path.Combine(YuzuDirectoryPath, "version");
File.WriteAllText(filePath, versionNumber);
base.RaiseUpdateProgressDelegate(100, "Done");

// cleanup
base.RaiseUpdateProgressDelegate(0, "Cleaning up ...");
base.CleanUpDirectories();
base.RaiseUpdateProgressDelegate(100, "Done");
};
client.DownloadProgressChanged += (s, e) => base.RaiseUpdateProgressDelegate(e.ProgressPercentage, $@"Downloading Yuzu Early Access {versionNumber} ...");
await client.DownloadFileTaskAsync(new Uri(asset.BrowserDownloadUrl), Path.Combine(TempUpdateDirectoryPath, "yuzu.zip"));
}
}

private async Task<Repo> GetEarlyAccessGitHubRepoJsonData()
{
// get the latest json manifest from repo
// convert it back into Repo object
using var client = new WebClient();
client.Headers.Add("User-Agent", "request");
string json = await client.DownloadStringTaskAsync(new Uri(EarlyAccessYuzuRepoJsonUrl));
using var stream = new MemoryStream(Encoding.Default.GetBytes(json));
return await JsonSerializer.DeserializeAsync<Repo>(stream).ConfigureAwait(false);
}
}
}
Loading

0 comments on commit d996503

Please sign in to comment.