Skip to content

Commit

Permalink
Check if Java is installed before patching
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/Properties/AssemblyInfo.cs
	modified:   Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyProgram.cs
  • Loading branch information
HyperPolygon64 committed Jan 30, 2020
1 parent 98fef3d commit 8e467fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Sonic-06-Mod-Manager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
[assembly: ComVisible(false)]
[assembly: Guid("277111e3-79d8-41b5-b0d7-7609dff6e36f")]
[assembly: AssemblyVersion("2.0.0.6")]
[assembly: AssemblyFileVersion("3.0.1.0")]
[assembly: AssemblyFileVersion("3.0.2.0")]
27 changes: 14 additions & 13 deletions Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,21 +1033,22 @@ private void SectionButton_InstallMods_Click(object sender, EventArgs e) {
RedirectSaves(mod.SubItems[6].Text, mod.Text);
}
}

// Begin tweak application
try { TweakEngine.ApplyTweaks(this); }
catch (Exception ex) {
UnifyMessenger.UnifyMessage.ShowDialog($"An error occurred whilst applying your tweaks...\n\n{ex}",
"Installation failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;

try {
TweakEngine.ApplyTweaks(this); // Begin tweak application
InstallPatches(); // Begin patch installation
}

// Begin patch installation
try { InstallPatches(); }
catch (Exception ex) {
UnifyMessenger.UnifyMessage.ShowDialog($"An error occurred whilst installing your patches...\n\n{ex}",
"Installation failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
if (_debug) Console.WriteLine(ex.ToString());
if (ex is Win32Exception) {
UnifyMessenger.UnifyMessage.ShowDialog($"Sonic '06 Mod Manager requires Java to decompile Lua scripts. Please install Java and restart your computer...",
"Missing pre-requisites", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
} else {
UnifyMessenger.UnifyMessage.ShowDialog($"An error occurred whilst installing your patches and tweaks...\n\n{ex}",
"Installation failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}

// Check skipped list to ensure any errors occurred
Expand Down
2 changes: 1 addition & 1 deletion Sonic-06-Mod-Manager/src/UnifyProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Unify.Environment3
{
static class Program
{
public static readonly string VersionNumber = "Version 3.01";
public static readonly string VersionNumber = "Version 3.02";
public static string ApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
Arctool = $"{ApplicationData}\\Unify\\Tools\\arctool.exe",
XexTool = $"{ApplicationData}\\Unify\\Tools\\xextool.exe",
Expand Down

0 comments on commit 8e467fa

Please sign in to comment.