unity-patch icon indicating copy to clipboard operation
unity-patch copied to clipboard

Create a GUI Version

Open TrevTV opened this issue 5 years ago • 4 comments

Added a WinForm/MetroForm application that calls the original Patcher.exe to make it simpler to use The current version selection list contains the unity versions working on windows listed in the README

9ssj6rwU81

TrevTV avatar Jul 20 '20 18:07 TrevTV

Thanks a lot for your pull request! I greatly appreciate the effort you put in, but I do have two small questions before we can merge your PR.

Since .NET Core 3.1, it's possible for WinForms applications to be cross platform, do you think you could re-target the GUI to make it run on that runtime instead of .NET 4.8? The patch supports multiple OSes, and it'd be a shame if Linux and Mac users couldn't use your GUI.

Lastly, I'm not entirely sure about having the Unity logo in the patch UI, as it's probably trademarked/copyrighted, and could potentially get us in trouble.

Looking forward to hearing your thoughts, and again, big thanks for the contribution!

aevitas avatar Jul 23 '20 15:07 aevitas

Hello, I went ahead and removed the unity logo from the solution and moved to .NET Core 3.1. Since MetroFramework (the framework that was used to make the ui look nice) isn't open source and couldn't be converted to Core 3.1, I switched to MaterialSkin. I also added multiplatform support, I haven't been able to test anything other than Windows though. Edit: Forgot to mention that MainForm is unviewable in the designer when the base class is set to MaterialThemeForm, everything I tried didn't fix it. Building works fine though

This is what the UI looks like now using MaterialSkin fCkDkXrrqT

TrevTV avatar Jul 24 '20 02:07 TrevTV

Hey @TrevTV, looks awesome! Great Job! I tried to build it on macOS but currently it gives the following error:

/usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error NETSDK1100: Windows is required to build Windows desktop applications. [~/Downloads/unity-patch-master/gui_src/Patcher/Patcher.csproj]

I haven't had time to look at it much more, but glancing over the code I noticed the openFileDialog.Filter = "Unity Editor|Unity.exe"; which I am pretty sure will not work on macOS or Linux. Since on macOS you would want to select "Unity.app" or a file called simply "Unity" (this one is also how the Executable is called on Linux).

@aevitas It also might make sense, in the future, to either create a common project for the Console and the Gui to share Code like getting a list of installed Unity versions, or to make that information accessible by running the Console with specific commands like Patcher --list-versions

maximilianmaihoefner avatar Jul 28 '20 13:07 maximilianmaihoefner

That shouldn't be too much work assuming the methods backing those commands are publicly accessible. I agree that sticking to a single set of APIs for those common operations is a good idea, I'll see what I can do to make those methods available to the GUI as well.

aevitas avatar Jul 28 '20 14:07 aevitas