Skip to content

Commit

Permalink
v1.1.0.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amakvana committed Jul 22, 2020
1 parent 2e4368c commit 410eea2
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 25 deletions.
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Option | Description
--- | ---
`Dependencies` | (Re)Installs Redistributables. Helpful if Yuzu won't start after update.
`New Install` | Installs Yuzu & Redistributables. Resets configs & sets optimised defaults
`New Install` | Installs Yuzu & Redistributables. Resets configs & sets optimised GPU defaults.
`Upgrade` | Upgrades Yuzu to the latest version, including Redistributables but excluding configs.
`Yuzu` | Updates Yuzu to the latest version, excluding Redistributables and configs.

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EzYuzu
A Portable Yuzu Updater for Standalone versions of Yuzu.

Perfect for those who run Yuzu through frontends (but not limited to) such as Launchbox, Steam, EmulationStation and Hyperspin.
Perfect for those who run Yuzu through (but not limited to) frontends such as Launchbox, Steam, EmulationStation and Hyperspin.

## Overview
![EzYuzu](images/ezyuzu.png)
Expand Down Expand Up @@ -32,13 +32,13 @@ EzYuzu is 100% portable - it can be run from any location.
EzYuzu requires Administrator privileges to ensure Dependencies can be installed.

## Hashes
Hashes of EzYuzu.exe below:
Hashes of latest EzYuzu.exe below:
Hash | Value
--- | ---
MD5 | 59adf18c2f2ff2471945691d82ff68a5
SHA1 | 13eb3b1146aebbc18a3aa21acdc168c4fe2dfab3
SHA256 | b615b3f5b1470e90a15790f63c21426bfc24c0159331449e73ccc8e9609e3fb7
SHA512 | dee247036fd5f45ac3e377ceefd0225f4c81d5934d6e31b149f0cf2bc0ca613d96ca7e7a95599b99db33e818a2575349a8420ac3fce98d0b6a39fcdb45d39c74
MD5 | 8c87e3f5af6ebc3b7b525585c58a3fa7
SHA1 | 7a2d01e91e7c4fc5fa3470a6630fa52cc3e21dd4
SHA256 | 326529099c5f07fb1237f1c4840abd082d1973a55b80ebfd39caf0ad2422b4cf
SHA512 | 9b16503ce44bd05c0a8c411eb349b8a0d16bd8b7dbaff082912497e4e7ffe169dff24a1f7efc33ebb2f6c8855c39d565029c6b2e81c7d53d8315ef7c7699603a

## Acknowledgements
Thanks:
Expand Down
1 change: 1 addition & 0 deletions source/EzYuzu/EzYuzu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Management" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down
4 changes: 2 additions & 2 deletions source/EzYuzu/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
72 changes: 56 additions & 16 deletions source/EzYuzu/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Management;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand Down Expand Up @@ -91,7 +92,7 @@ private void CboOptions_SelectedIndexChanged(object sender, EventArgs e)
}
break;
case 1: // new install
message = string.Format("This will install a fresh copy of Yuzu and its Dependencies{0}{0}It will overwrite any existing files and reset configs in the Yuzu root folder selected{0}{0}Do not use this to Upgrade Yuzu", Environment.NewLine);
message = string.Format("This will install a fresh copy of Yuzu and its Dependencies{0}{0}It will overwrite any existing files, reset configs and set optimised GPU defaults in the Yuzu root folder selected{0}{0}Do not use this to Upgrade Yuzu", Environment.NewLine);
MessageBox.Show(message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
btnProcess.Text = "Install";
break;
Expand Down Expand Up @@ -210,8 +211,7 @@ private async Task ProcessDependencies(string yuzuLocation)
wc.DownloadFileCompleted += (s, e) =>
{
// install
lblProgress.Text = "Installing Visual C++ 2019 ...";
lblProgress.Refresh();
SetProgressLabelStatus("Installing Visual C++ 2019 ...");
using (Process p = new Process())
{
p.StartInfo.FileName = tempDir + "\\vc_redist.x64.exe";
Expand All @@ -227,14 +227,12 @@ private async Task ProcessDependencies(string yuzuLocation)
Directory.Delete(tempDir, true);
}
catch { }
lblProgress.Text = "Installed!";
lblProgress.Refresh();
SetProgressLabelStatus("Installed!");
btnProcess.Enabled = true;
pbarProgress.Value = 0;
};
wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
lblProgress.Text = "Downloading Visual C++ 2019 ...";
lblProgress.Refresh();
SetProgressLabelStatus("Downloading Visual C++ 2019 ...");
await wc.DownloadFileTaskAsync(new Uri("https://aka.ms/vs/16/release/vc_redist.x64.exe"), tempDir + "\\vc_redist.x64.exe");
}
}
Expand All @@ -256,16 +254,21 @@ private void ProcessNewInstall(string yuzuLocation)
}

// download vc++, yuzu and setup User folder
ProcessUpgrade(yuzuLocation);
Directory.CreateDirectory(yuzuLocation + "\\User");
Directory.CreateDirectory(yuzuLocation + "\\User\\keys");
Directory.CreateDirectory(yuzuLocation + "\\User\\config");
ProcessUpgrade(yuzuLocation, true);
}

private async void ProcessUpgrade(string yuzuLocation)
private async void ProcessUpgrade(string yuzuLocation, bool newInstall = false)
{
// Update dependencies and Yuzu but DO NOT touch configs
await Task.WhenAll(ProcessDependencies(yuzuLocation));
await Task.WhenAll(ProcessYuzu(yuzuLocation));
if (newInstall)
{
await Task.WhenAll(GetGPUConfig(yuzuLocation));
}
}

/// <summary>
Expand Down Expand Up @@ -305,8 +308,7 @@ private async Task ProcessYuzu(string yuzuLocation)
wc.DownloadFileCompleted += (s, e) =>
{
// unpack
lblProgress.Text = "Unpacking Yuzu ...";
lblProgress.Refresh();
SetProgressLabelStatus("Unpacking Yuzu ...");
ZipFile.ExtractToDirectory(tempDir + "\\yuzu.zip", yuzuLocation);
// update version number
Expand All @@ -320,15 +322,12 @@ private async Task ProcessYuzu(string yuzuLocation)
Directory.Delete(yuzuLocation + "\\yuzu-windows-msvc", true);
Directory.Delete(tempDir, true);
Directory.EnumerateFiles(yuzuLocation, "*.xz").ToList().ForEach(item => File.Delete(item));
lblProgress.Text = "Done!";
lblProgress.Refresh();
SetProgressLabelStatus("Done!");
btnProcess.Enabled = true;
pbarProgress.Value = 0;
};
wc.DownloadProgressChanged += Wc_DownloadProgressChanged;

lblProgress.Text = "Downloading Yuzu ...";
lblProgress.Refresh();
SetProgressLabelStatus("Downloading Yuzu ...");
await wc.DownloadFileTaskAsync(new Uri(latestYuzu), tempDir + "\\yuzu.zip");
}
}
Expand All @@ -347,5 +346,46 @@ private bool DependenciesInstalled()
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum", false);
return (key != null) ? key.GetValue("Version").ToString().StartsWith("14") : false;
}

private async Task GetGPUConfig(string yuzuLocation)
{
btnProcess.Enabled = false;
// detect current GPU
bool useOpenGL = false;
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"))
{
foreach (ManagementObject obj in searcher.Get())
{
if (obj["Name"].ToString().ToLower().Contains("nvidia"))
{
useOpenGL = true;
}
}
}

// fetch optimised config based on installed GPU
using (var wc = new WebClient())
{
// download it
wc.DownloadFileCompleted += (s, e) =>
{
SetProgressLabelStatus("Done!");
btnProcess.Enabled = true;
pbarProgress.Value = 0;
};
wc.DownloadProgressChanged += Wc_DownloadProgressChanged;

string gpuConfigUrl = "https://github.com/amakvana/EzYuzu/raw/master/configs/";
gpuConfigUrl += (useOpenGL) ? "opengl.ini" : "vulkan.ini";
SetProgressLabelStatus("Downloading Optimised GPU Config ...");
await wc.DownloadFileTaskAsync(new Uri(gpuConfigUrl), yuzuLocation + "\\User\\config\\qt-config.ini");
}
}

private void SetProgressLabelStatus(string status)
{
lblProgress.Text = status;
lblProgress.Refresh();
}
}
}

0 comments on commit 410eea2

Please sign in to comment.