Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KMStev/BuildToolsGUI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: 0uti/BuildToolsGUI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 17 commits
  • 19 files changed
  • 2 contributors

Commits on Jul 1, 2018

  1. removed GoogleAnalytics

    updated dependencies
    0uti committed Jul 1, 2018
    Copy the full SHA
    fcefa6b View commit details
  2. Update readme.md

    0uti authored Jul 1, 2018
    Copy the full SHA
    c96fd79 View commit details
  3. point to new json file

    0uti committed Jul 1, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8e168cd View commit details
  4. update git URL

    remove unused stuff
    0uti committed Jul 1, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cea3568 View commit details

Commits on Jul 21, 2018

  1. VersionBump

    0uti committed Jul 21, 2018
    Copy the full SHA
    fbbf59a View commit details

Commits on Nov 2, 2018

  1. added json file for webservers

    0uti committed Nov 2, 2018
    Copy the full SHA
    1e7eaed View commit details

Commits on Nov 11, 2018

  1. Copy the full SHA
    693451d View commit details

Commits on Nov 26, 2018

  1. get rid of external Zip library

    added build version auto increment
    0uti committed Nov 26, 2018
    Copy the full SHA
    519217e View commit details

Commits on Dec 23, 2019

  1. update .sln to VS2019

    some minor code cleanup
    0uti committed Dec 23, 2019
    Copy the full SHA
    b71c8da View commit details

Commits on Jun 11, 2020

  1. some UI tweaks and code formatting

    Signed-off-by: Outi <me@outi-networks.de>
    0uti committed Jun 11, 2020
    Copy the full SHA
    77e8e13 View commit details
  2. version bump

    0uti committed Jun 11, 2020
    Copy the full SHA
    d7d8848 View commit details

Commits on Jun 18, 2020

  1. added UserAgent to webrequests

    updated readme.md
    0uti committed Jun 18, 2020
    Copy the full SHA
    2a7c9a6 View commit details

Commits on Nov 19, 2021

  1. update .Net version

    reworked Java detection - BuildToolsGui now brings his own java.
    0uti committed Nov 19, 2021
    Copy the full SHA
    e5d29c3 View commit details

Commits on Apr 2, 2022

  1. Copy the full SHA
    6d572f9 View commit details
  2. Bump Version

    0uti committed Apr 2, 2022
    Copy the full SHA
    601d0c2 View commit details

Commits on Jul 2, 2022

  1. Copy the full SHA
    f1c859e View commit details

Commits on Aug 5, 2022

  1. fixed #3

    0uti committed Aug 5, 2022
    Copy the full SHA
    f16e794 View commit details
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = none
13 changes: 11 additions & 2 deletions BuildTools.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTools", "BuildTools\BuildTools.csproj", "{8899E123-EC11-441D-B805-3C227B2704E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UninstallJava", "UninstallJava\UninstallJava.csproj", "{87A0AD87-774D-40B8-B9F3-03512357BC5C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6ED77B62-39F9-47D6-8279-D591F42E5A67}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -25,4 +30,8 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46F958E3-D2E3-4B97-8A22-DA8DB5715BA0}
BuildVersion_StartDate = 2000/1/1
EndGlobalSection
EndGlobal
10 changes: 5 additions & 5 deletions BuildTools/App.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>
79 changes: 51 additions & 28 deletions BuildTools/BuildTools.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 16 additions & 47 deletions BuildTools/BuildTools.cs
Original file line number Diff line number Diff line change
@@ -34,10 +34,8 @@ public partial class BuildTools : Form {
// Stuff
private readonly Runner _runner;
private string _lastLog = "";
private volatile List<string> _versions = new List<string>();
private readonly GoogleAnalytics _googleAnalytics;
private bool _running;
private Job _job;
private readonly List<string> _versions = new List<string>();
private readonly Job _job;

[DllImport("user32.dll", SetLastError = true)]
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
@@ -48,8 +46,7 @@ public partial class BuildTools : Form {
public BuildTools(Guid guid, Job job) {
InitializeComponent();
_job = job;
_googleAnalytics = new GoogleAnalytics(guid);
_runner = new Runner(this, _job, _googleAnalytics);
_runner = new Runner(this, _job);
undoBT.Visible = false;
progress.Visible = false;

@@ -75,73 +72,49 @@ public BuildTools(Guid guid, Job job) {
}

Console.WriteLine(guid.ToString());
new Thread(delegate () {
_googleAnalytics.SendEvent("Application", "Start");
}).Start();

}

// Run BuildTools Button Clicked
private void runBT_Click(object sender, EventArgs e) {
private void RunBT_Click(object sender, EventArgs e) {
bool update = autoUpdateCB.Checked;
bool remapped = checkRemapped.Checked;
string version;
if (versionBox.SelectedIndex == 0) {
version = "latest";
} else {
version = _versions[versionBox.SelectedIndex - 1];
}

_running = true;

Thread thread = new Thread(delegate() {
_googleAnalytics.SendEvent("BuildTools Run", "Version: " + version);
_googleAnalytics.StartTimer("BuildTools Run Time");
_runner.RunBuildTools(update, version);
_runner.RunBuildTools(update, version, remapped);
Enable();
ProgressHide();
_googleAnalytics.EndTimer("BuildTools Run Time");
_running = false;
});
Disable();
thread.Start();
}

// Update BuildTools Button Clicked
private void updateBT_Click(object sender, EventArgs e) {
_running = true;


private void UpdateBT_Click(object sender, EventArgs e) {

Thread thread = new Thread(delegate() {
_googleAnalytics.SendEvent("BuildTools Update", "Run");
_googleAnalytics.StartTimer("BuildTools Update Time");
_runner.UpdateJar();
Enable();
ProgressHide();
_googleAnalytics.EndTimer("BuildTools Update Time");
_running = false;
});
Disable();
thread.Start();
}

// Clear Log Button Clicked
private void clearBT_Click(object sender, EventArgs e) {
new Thread(delegate () {
_googleAnalytics.SendEvent("Log", "Clear Button");
}).Start();

private void ClearBT_Click(object sender, EventArgs e) {
_lastLog += outputTB.Text;
outputTB.Text = "";
undoBT.Visible = true;
}

// Undo Button Clicked
private void undoBT_Click(object sender, EventArgs e) {
new Thread(delegate () {
_googleAnalytics.SendEvent("Log", "Undo Button");
}).Start();

private void UndoBT_Click(object sender, EventArgs e) {
outputTB.Text = _lastLog + outputTB.Text;
_lastLog = "";
undoBT.Visible = false;
@@ -253,28 +226,23 @@ public void Progress(int place, int total) {
// Exit button pressed
private void BuildTools_FormClosed(object sender, FormClosedEventArgs e) {
_runner.CleanUp();
if (_running) {
_googleAnalytics.SendEvent("BuildTools Run", "Premature Cancelation");
_googleAnalytics.EndTimer("BuildTools Run Time");
}
_job.Dispose();
Application.Exit();
Environment.Exit(0);
}

// Source link clicked
private void linkLabel_Click(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start("https://github.com/DemonWav/BuildToolsGUI");
new Thread(delegate () {
_googleAnalytics.SendEvent("Source", "Link Clicked");
}).Start();
private void LinkLabel_Click(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start("https://github.com/0uti/BuildToolsGUI");
}

private void GetVersions() {
new Thread(delegate () {
string versionsHtml = GetHtml("https://hub.spigotmc.org/versions/");
if (versionsHtml == "")
if (string.IsNullOrEmpty(versionsHtml))
{
return;
}

// Convert the HTML to XHTML to use an XML parser
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
@@ -298,6 +266,7 @@ private void GetVersions() {
private static string GetHtml(string url) {
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
try {
request.UserAgent = "BuildToolsGui";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

if (response.StatusCode == HttpStatusCode.OK) {
@@ -343,7 +312,7 @@ private void UpdateVersions() {
}
}

private void autoUpdateCB_Click(object sender, EventArgs e) {
private void AutoUpdateCB_Click(object sender, EventArgs e) {
if (autoUpdateCB.Checked) {
File.WriteAllText(Program.CheckUpdate, "true");
} else {
Loading