This commit is contained in:
Thomas G 2022-08-05 10:31:17 +10:00
parent ebcef2c3fb
commit e54405800c
37 changed files with 182 additions and 133 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\ARCHBLOXLauncherGUI.sln",
"PreviewInSolutionExplorer": false
}

BIN
.vs/slnx.sqlite Normal file

Binary file not shown.

View File

@ -6,10 +6,10 @@
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>archblox.ico</ApplicationIcon> <ApplicationIcon>archblox.ico</ApplicationIcon>
<AssemblyName>$(MSBuildProjectName)</AssemblyName> <AssemblyName>$(MSBuildProjectName)</AssemblyName>
<PackageProjectUrl>https://www.archblox.com</PackageProjectUrl> <PackageProjectUrl>http://www.archblox.com</PackageProjectUrl>
<Description>ARCHBLOX Launcher</Description> <Description>ARCHBLOX Launcher</Description>
<PackageIcon>archblox.png</PackageIcon> <PackageIcon>archblox.png</PackageIcon>
<RepositoryUrl>https://www.github.com/thomasluigi07/ARCHBLOXLauncher</RepositoryUrl> <RepositoryUrl>http://www.github.com/thomasluigi07/ARCHBLOXLauncher</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<AssemblyVersion>2.7</AssemblyVersion> <AssemblyVersion>2.7</AssemblyVersion>
<FileVersion>2.7</FileVersion> <FileVersion>2.7</FileVersion>

View File

@ -1,4 +1,6 @@
using System; using System;
using System.Security.Cryptography;
using System.IO;
namespace ARCHBLOXLauncherGUI namespace ARCHBLOXLauncherGUI
{ {

76
Form1.Designer.cs generated
View File

@ -57,9 +57,9 @@
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top; this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.Image = global::ARCHBLOXLauncherGUI.Properties.Resources.unknown; this.pictureBox1.Image = global::ARCHBLOXLauncherGUI.Properties.Resources.unknown;
this.pictureBox1.Location = new System.Drawing.Point(51, 11); this.pictureBox1.Location = new System.Drawing.Point(51, 12);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(203, 37); this.pictureBox1.Size = new System.Drawing.Size(203, 40);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 0; this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
@ -72,9 +72,9 @@
this.JoinBox.Controls.Add(this.serverport); this.JoinBox.Controls.Add(this.serverport);
this.JoinBox.Controls.Add(this.label7); this.JoinBox.Controls.Add(this.label7);
this.JoinBox.Controls.Add(this.button2); this.JoinBox.Controls.Add(this.button2);
this.JoinBox.Location = new System.Drawing.Point(7, 48); this.JoinBox.Location = new System.Drawing.Point(7, 51);
this.JoinBox.Name = "JoinBox"; this.JoinBox.Name = "JoinBox";
this.JoinBox.Size = new System.Drawing.Size(286, 140); this.JoinBox.Size = new System.Drawing.Size(286, 150);
this.JoinBox.TabIndex = 26; this.JoinBox.TabIndex = 26;
this.JoinBox.TabStop = false; this.JoinBox.TabStop = false;
this.JoinBox.Visible = false; this.JoinBox.Visible = false;
@ -83,40 +83,40 @@
// //
this.serverip.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower; this.serverip.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower;
this.serverip.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.serverip.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.serverip.Location = new System.Drawing.Point(6, 37); this.serverip.Location = new System.Drawing.Point(6, 40);
this.serverip.MaxLength = 15; this.serverip.MaxLength = 15;
this.serverip.Name = "serverip"; this.serverip.Name = "serverip";
this.serverip.PlaceholderText = "IP"; this.serverip.PlaceholderText = "IP";
this.serverip.Size = new System.Drawing.Size(276, 21); this.serverip.Size = new System.Drawing.Size(276, 23);
this.serverip.TabIndex = 18; this.serverip.TabIndex = 18;
// //
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Location = new System.Drawing.Point(6, 18); this.label4.Location = new System.Drawing.Point(6, 19);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(277, 14); this.label4.Size = new System.Drawing.Size(270, 15);
this.label4.TabIndex = 17; this.label4.TabIndex = 17;
this.label4.Text = "Server IP (Use localhost if joining your own server)"; this.label4.Text = "Server IP (Use localhost if joining your own server)";
// //
// serverport // serverport
// //
this.serverport.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.serverport.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.serverport.Location = new System.Drawing.Point(6, 78); this.serverport.Location = new System.Drawing.Point(6, 84);
this.serverport.MaxLength = 5; this.serverport.MaxLength = 5;
this.serverport.Name = "serverport"; this.serverport.Name = "serverport";
this.serverport.PlaceholderText = "PORT"; this.serverport.PlaceholderText = "PORT";
this.serverport.Size = new System.Drawing.Size(274, 21); this.serverport.Size = new System.Drawing.Size(274, 23);
this.serverport.TabIndex = 19; this.serverport.TabIndex = 19;
// //
// label7 // label7
// //
this.label7.AutoSize = true; this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent; this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Location = new System.Drawing.Point(6, 62); this.label7.Location = new System.Drawing.Point(6, 66);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(67, 14); this.label7.Size = new System.Drawing.Size(64, 15);
this.label7.TabIndex = 25; this.label7.TabIndex = 25;
this.label7.Text = "Server Port"; this.label7.Text = "Server Port";
// //
@ -127,9 +127,9 @@
this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button2.Location = new System.Drawing.Point(6, 109); this.button2.Location = new System.Drawing.Point(6, 117);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(274, 21); this.button2.Size = new System.Drawing.Size(274, 22);
this.button2.TabIndex = 24; this.button2.TabIndex = 24;
this.button2.Text = "Join"; this.button2.Text = "Join";
this.button2.UseVisualStyleBackColor = false; this.button2.UseVisualStyleBackColor = false;
@ -144,9 +144,9 @@
this.HostBox.Controls.Add(this.button3); this.HostBox.Controls.Add(this.button3);
this.HostBox.Controls.Add(this.textBox2); this.HostBox.Controls.Add(this.textBox2);
this.HostBox.Controls.Add(this.button1); this.HostBox.Controls.Add(this.button1);
this.HostBox.Location = new System.Drawing.Point(7, 48); this.HostBox.Location = new System.Drawing.Point(7, 51);
this.HostBox.Name = "HostBox"; this.HostBox.Name = "HostBox";
this.HostBox.Size = new System.Drawing.Size(288, 131); this.HostBox.Size = new System.Drawing.Size(288, 140);
this.HostBox.TabIndex = 27; this.HostBox.TabIndex = 27;
this.HostBox.TabStop = false; this.HostBox.TabStop = false;
this.HostBox.Visible = false; this.HostBox.Visible = false;
@ -155,29 +155,29 @@
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(4, 18); this.label2.Location = new System.Drawing.Point(4, 19);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 14); this.label2.Size = new System.Drawing.Size(162, 15);
this.label2.TabIndex = 23; this.label2.TabIndex = 23;
this.label2.Text = "Port (53640 is recommended)"; this.label2.Text = "Port (53640 is recommended)";
// //
// textBox1 // textBox1
// //
this.textBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.textBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.textBox1.Location = new System.Drawing.Point(6, 35); this.textBox1.Location = new System.Drawing.Point(6, 38);
this.textBox1.MaxLength = 5; this.textBox1.MaxLength = 5;
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.PlaceholderText = "PORT"; this.textBox1.PlaceholderText = "PORT";
this.textBox1.Size = new System.Drawing.Size(274, 21); this.textBox1.Size = new System.Drawing.Size(274, 23);
this.textBox1.TabIndex = 24; this.textBox1.TabIndex = 24;
// //
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Location = new System.Drawing.Point(4, 59); this.label3.Location = new System.Drawing.Point(4, 63);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(190, 14); this.label3.Size = new System.Drawing.Size(187, 15);
this.label3.TabIndex = 27; this.label3.TabIndex = 27;
this.label3.Text = "Filename (use temp.rbxl if unsure)"; this.label3.Text = "Filename (use temp.rbxl if unsure)";
// //
@ -187,9 +187,9 @@
this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button3.Location = new System.Drawing.Point(207, 75); this.button3.Location = new System.Drawing.Point(207, 80);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(73, 21); this.button3.Size = new System.Drawing.Size(73, 22);
this.button3.TabIndex = 26; this.button3.TabIndex = 26;
this.button3.Text = "Browse..."; this.button3.Text = "Browse...";
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
@ -198,10 +198,10 @@
// textBox2 // textBox2
// //
this.textBox2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.textBox2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.textBox2.Location = new System.Drawing.Point(6, 76); this.textBox2.Location = new System.Drawing.Point(6, 81);
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.PlaceholderText = "Filename"; this.textBox2.PlaceholderText = "Filename";
this.textBox2.Size = new System.Drawing.Size(195, 21); this.textBox2.Size = new System.Drawing.Size(195, 23);
this.textBox2.TabIndex = 25; this.textBox2.TabIndex = 25;
// //
// button1 // button1
@ -211,9 +211,9 @@
this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button1.Location = new System.Drawing.Point(6, 102); this.button1.Location = new System.Drawing.Point(6, 109);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(274, 21); this.button1.Size = new System.Drawing.Size(274, 22);
this.button1.TabIndex = 28; this.button1.TabIndex = 28;
this.button1.Text = "Host"; this.button1.Text = "Host";
this.button1.UseVisualStyleBackColor = false; this.button1.UseVisualStyleBackColor = false;
@ -226,9 +226,9 @@
this.HostBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.HostBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.HostBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.HostBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.HostBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.HostBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.HostBTN.Location = new System.Drawing.Point(12, 121); this.HostBTN.Location = new System.Drawing.Point(12, 130);
this.HostBTN.Name = "HostBTN"; this.HostBTN.Name = "HostBTN";
this.HostBTN.Size = new System.Drawing.Size(137, 49); this.HostBTN.Size = new System.Drawing.Size(137, 52);
this.HostBTN.TabIndex = 28; this.HostBTN.TabIndex = 28;
this.HostBTN.Text = "Host a Game"; this.HostBTN.Text = "Host a Game";
this.HostBTN.UseVisualStyleBackColor = true; this.HostBTN.UseVisualStyleBackColor = true;
@ -241,9 +241,9 @@
this.JoinBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.JoinBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.JoinBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.JoinBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.JoinBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.JoinBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.JoinBTN.Location = new System.Drawing.Point(155, 121); this.JoinBTN.Location = new System.Drawing.Point(155, 130);
this.JoinBTN.Name = "JoinBTN"; this.JoinBTN.Name = "JoinBTN";
this.JoinBTN.Size = new System.Drawing.Size(135, 49); this.JoinBTN.Size = new System.Drawing.Size(135, 52);
this.JoinBTN.TabIndex = 29; this.JoinBTN.TabIndex = 29;
this.JoinBTN.Text = "Join a Game"; this.JoinBTN.Text = "Join a Game";
this.JoinBTN.UseVisualStyleBackColor = true; this.JoinBTN.UseVisualStyleBackColor = true;
@ -256,9 +256,9 @@
this.UpdateBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.UpdateBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.UpdateBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.UpdateBTN.Font = new System.Drawing.Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.UpdateBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.UpdateBTN.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.UpdateBTN.Location = new System.Drawing.Point(12, 66); this.UpdateBTN.Location = new System.Drawing.Point(12, 71);
this.UpdateBTN.Name = "UpdateBTN"; this.UpdateBTN.Name = "UpdateBTN";
this.UpdateBTN.Size = new System.Drawing.Size(276, 49); this.UpdateBTN.Size = new System.Drawing.Size(277, 53);
this.UpdateBTN.TabIndex = 30; this.UpdateBTN.TabIndex = 30;
this.UpdateBTN.Text = "Install"; this.UpdateBTN.Text = "Install";
this.UpdateBTN.UseVisualStyleBackColor = true; this.UpdateBTN.UseVisualStyleBackColor = true;
@ -269,9 +269,9 @@
this.BackBTN.BackgroundImage = global::ARCHBLOXLauncherGUI.Properties.Resources.buttonblue; this.BackBTN.BackgroundImage = global::ARCHBLOXLauncherGUI.Properties.Resources.buttonblue;
this.BackBTN.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.BackBTN.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.BackBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.BackBTN.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.BackBTN.Location = new System.Drawing.Point(254, 19); this.BackBTN.Location = new System.Drawing.Point(254, 20);
this.BackBTN.Name = "BackBTN"; this.BackBTN.Name = "BackBTN";
this.BackBTN.Size = new System.Drawing.Size(42, 21); this.BackBTN.Size = new System.Drawing.Size(42, 22);
this.BackBTN.TabIndex = 31; this.BackBTN.TabIndex = 31;
this.BackBTN.Text = "Back"; this.BackBTN.Text = "Back";
this.BackBTN.UseVisualStyleBackColor = true; this.BackBTN.UseVisualStyleBackColor = true;
@ -280,12 +280,12 @@
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(107)))), ((int)(((byte)(223))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(107)))), ((int)(((byte)(223)))));
this.BackgroundImage = global::ARCHBLOXLauncherGUI.Properties.Resources.animated; this.BackgroundImage = global::ARCHBLOXLauncherGUI.Properties.Resources.animated;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(302, 193); this.ClientSize = new System.Drawing.Size(302, 207);
this.Controls.Add(this.BackBTN); this.Controls.Add(this.BackBTN);
this.Controls.Add(this.UpdateBTN); this.Controls.Add(this.UpdateBTN);
this.Controls.Add(this.JoinBTN); this.Controls.Add(this.JoinBTN);

View File

@ -1,6 +1,4 @@
using System; using System;
using System.ComponentModel;
using System.Drawing;
using System.Text; using System.Text;
using IWshRuntimeLibrary; using IWshRuntimeLibrary;
using System.Diagnostics; using System.Diagnostics;
@ -30,16 +28,26 @@ namespace ARCHBLOXLauncherGUI
bool ingame = false; bool ingame = false;
bool hosting = false; bool hosting = false;
private static WebClient wc = new WebClient(); private static WebClient wc = new WebClient();
static byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt"); static byte[] raw = wc.DownloadData("http://archblox.com/client/version.txt");
static string webData = Encoding.UTF8.GetString(raw); static string webData = Encoding.UTF8.GetString(raw);
static string version_string = webData; static string version_string = webData;
static string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\"); static string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\");
static string clientPath = Path.Combine(folderPath, version_string + @"\"); static string clientPath = Path.Combine(folderPath, version_string + @"\");
static string filePath = Path.Combine(clientPath, "ArchbloxPlayerBeta.exe"); static string filePath = Path.Combine(clientPath, "ArchbloxPlayerBeta.exe");
// animations delegate void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e);
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
// Check for a internet connection
try
{
wc.DownloadData("http://archblox.com/client/version.txt");
}
catch
{
MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: HttpOpenRequest failed for GET http://archblox.com/client/version.txt, Error ID: 6", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
}
ARCHBLOXProtocol.ARCHBLOXURIProtocol.Register(); ARCHBLOXProtocol.ARCHBLOXURIProtocol.Register();
CreateShortcut(); CreateShortcut();
var lastword = ""; var lastword = "";
@ -67,7 +75,7 @@ namespace ARCHBLOXLauncherGUI
} }
if (info1 == "" || info2 == "") if (info1 == "" || info2 == "")
{ {
MessageBox.Show("Paramaters are invalid. Please try again. (ID: 500)", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: Invalid Arguments, Error ID: 500", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0); Environment.Exit(0);
} }
var pProcess = new Process(); var pProcess = new Process();
@ -99,7 +107,7 @@ namespace ARCHBLOXLauncherGUI
} }
if (info1 == "" || info2 == "") if (info1 == "" || info2 == "")
{ {
MessageBox.Show("Paramaters are invalid. Please try again. (ID: 500)", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: Invalid Arguments, Error ID: 500", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0); Environment.Exit(0);
} }
var pProcess = new Process(); var pProcess = new Process();
@ -130,7 +138,6 @@ namespace ARCHBLOXLauncherGUI
// close program // close program
Environment.Exit(0); Environment.Exit(0);
} }
client = new DiscordRpcClient("996030605106090006"); client = new DiscordRpcClient("996030605106090006");
client.Initialize(); client.Initialize();
client.SetPresence(new RichPresence() client.SetPresence(new RichPresence()
@ -166,7 +173,7 @@ namespace ARCHBLOXLauncherGUI
} }
if (!System.IO.File.Exists(filePath)) if (!System.IO.File.Exists(filePath))
{ {
DialogResult res = MessageBox.Show("You need to install the latest version of ARCHBLOX to host. Would you like to install it?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); DialogResult res = MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: Out of date client! To update the client, select Yes or select the Install button on the main menu.", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (res == DialogResult.Yes) if (res == DialogResult.Yes)
{ {
ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2(); ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2();
@ -175,11 +182,11 @@ namespace ARCHBLOXLauncherGUI
} }
else if (textBox1.Text == "" || textBox2.Text == "") else if (textBox1.Text == "" || textBox2.Text == "")
{ {
MessageBox.Show("Please fill in all of the text fields.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Please fill in all of the text boxes.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
else if (rbxl == false) else if (rbxl == false)
{ {
MessageBox.Show("Please use a valid .RBXL! ." + sWord + " is not a supported file format.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: Invalid .RBXL, " + sWord + " is not a supported file format.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
else else
{ {
@ -247,7 +254,7 @@ namespace ARCHBLOXLauncherGUI
// joining // joining
if (!System.IO.File.Exists(filePath)) if (!System.IO.File.Exists(filePath))
{ {
DialogResult res = MessageBox.Show("You need to install the latest version of ARCHBLOX to join " + serverip.Text + ":" + serverport.Text + ". Would you like to install it?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); DialogResult res = MessageBox.Show("An error occoured while starting ARCHBLOX\n\nDetails: Out of date client! To update the client, select Yes or select the Install button on the main menu.", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (res == DialogResult.Yes) if (res == DialogResult.Yes)
{ {
ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2(); ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2();
@ -256,7 +263,7 @@ namespace ARCHBLOXLauncherGUI
} }
else if (serverip.Text == "" || serverport.Text == "") else if (serverip.Text == "" || serverport.Text == "")
{ {
MessageBox.Show("Please fill in all of the text fields.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Please fill in all of the text boxes.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
else else
{ {
@ -324,7 +331,7 @@ namespace ARCHBLOXLauncherGUI
OpenFileDialog dialog = new OpenFileDialog(); OpenFileDialog dialog = new OpenFileDialog();
dialog.Title = "Choose a RBXL..."; dialog.Title = "Choose a RBXL...";
dialog.AddExtension = true; dialog.AddExtension = true;
dialog.Filter = "Place File (*.rbxl)| *.rbxl"; dialog.Filter = "ROBLOX Place File (*.rbxl)| *.rbxl";
if (DialogResult.OK == dialog.ShowDialog()) if (DialogResult.OK == dialog.ShowDialog())
{ {
// check if it is a rbxl // check if it is a rbxl
@ -339,7 +346,7 @@ namespace ARCHBLOXLauncherGUI
if (line.Contains("<roblox!")) if (line.Contains("<roblox!"))
{ {
// is binary/unsupported format // is binary/unsupported format
MessageBox.Show("Sorry, binary .RBXL files are not supported. Please convert the RBXL into XML format using a converter, then try again.", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Binary ROBLOX Place files are not supported. Did you convert the place correctly, or use ARCHBLOX Studio to create the game?", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
else else
@ -355,13 +362,13 @@ namespace ARCHBLOXLauncherGUI
else if (word == ".rbxlx") else if (word == ".rbxlx")
{ {
// rbxlx, cringe! // rbxlx, cringe!
MessageBox.Show(".RBXLX file formats are not supported, are you sure you converted the .RBXL correctly?", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(".RBXLX place files are not supported! Are you sure you converted the place correctly?", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
else else
{ {
// wtf this isn't even a place // wtf this isn't even a place
MessageBox.Show(word.ToUpper() + " is not a supported file type!", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(word.ToUpper() + " is not a supported place file!", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
} }
@ -378,7 +385,14 @@ namespace ARCHBLOXLauncherGUI
private void UpdateBTN_Click(object sender, EventArgs e) private void UpdateBTN_Click(object sender, EventArgs e)
{ {
ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2(); ARCHBLOXLauncherGUI.Form2 form2 = new ARCHBLOXLauncherGUI.Form2();
form2.Show(); try
{
form2.Show();
}
catch
{
form2.Dispose();
}
} }
private void BackBTN_Click(object sender, EventArgs e) private void BackBTN_Click(object sender, EventArgs e)

31
Form2.Designer.cs generated
View File

@ -39,46 +39,51 @@
// //
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.Image = global::ARCHBLOXLauncherGUI.Properties.Resources.archblox; this.pictureBox1.Image = global::ARCHBLOXLauncherGUI.Properties.Resources.archblox;
this.pictureBox1.Location = new System.Drawing.Point(3, 6); this.pictureBox1.Location = new System.Drawing.Point(18, 17);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(46, 46); this.pictureBox1.Size = new System.Drawing.Size(35, 42);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0; this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.Location = new System.Drawing.Point(55, 9); this.label1.Location = new System.Drawing.Point(58, 18);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(144, 15); this.label1.Size = new System.Drawing.Size(237, 21);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
this.label1.Text = "Configuring ARCHBLOX..."; this.label1.Text = "Static";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
// //
// progressBar1 // progressBar1
// //
this.progressBar1.Location = new System.Drawing.Point(55, 27); this.progressBar1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.progressBar1.BackColor = System.Drawing.Color.White;
this.progressBar1.Location = new System.Drawing.Point(58, 51);
this.progressBar1.Name = "progressBar1"; this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(219, 23); this.progressBar1.Size = new System.Drawing.Size(287, 26);
this.progressBar1.TabIndex = 2; this.progressBar1.TabIndex = 2;
// //
// Form2 // Form2
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(280, 59); this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(352, 136);
this.Controls.Add(this.progressBar1); this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
this.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "Form2"; this.Name = "Form2";
this.Text = "ARCHBLOX Installer"; this.Text = "ARCHBLOX";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }

117
Form2.cs
View File

@ -20,7 +20,7 @@ namespace ARCHBLOXLauncherGUI
private static long GetDirectorySize(string folderPath) private static long GetDirectorySize(string folderPath)
{ {
// get size of a directory // get size of a directory, important for showing the user how much space ARCHBLOX takes
DirectoryInfo di = new DirectoryInfo(folderPath); DirectoryInfo di = new DirectoryInfo(folderPath);
return di.EnumerateFiles("*", SearchOption.AllDirectories).Sum(fi => fi.Length) / 1000000; return di.EnumerateFiles("*", SearchOption.AllDirectories).Sum(fi => fi.Length) / 1000000;
} }
@ -29,56 +29,73 @@ namespace ARCHBLOXLauncherGUI
{ {
InitializeComponent(); InitializeComponent();
// setup other variables // setup other variables
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt");
string webData = Encoding.UTF8.GetString(raw);
string version_string = webData;
string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\");
string clientPath = Path.Combine(folderPath, version_string + @"\");
string filePath = Path.Combine(clientPath, Path.GetFileName(@"https://archblox.com/client/" + version_string + ".zip"));
// setup file paths etc
{
if (Directory.Exists(folderPath))
{
// since the folder already exists, show size of folder and ask user if they want to delete older versions
DialogResult res = MessageBox.Show("Do you want to delete previous installs of ARCHBLOX? Current size of ARCHBLOX folder: " + GetDirectorySize(folderPath) + "MB.", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (res == DialogResult.Yes)
{
label1.Text = "Removing previous installs...";
Directory.Delete(folderPath, true);
}
}
}
// setup variables
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
progressBar1.Style = ProgressBarStyle.Marquee; progressBar1.Style = ProgressBarStyle.Marquee;
label1.Text = "Configuring ARCHBLOX..."; try
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
if (Directory.Exists(clientPath))
{ {
// ask user if they want to re-install wc.DownloadData("http://archblox.com/client/version.txt");
DialogResult res = MessageBox.Show("The latest version of ARCHBLOX is already installed. Do you want to re-install it?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); }
if (res == DialogResult.Yes) catch
{ {
label1.Text = "Removing previous install..."; MessageBox.Show("An error occoured while installing ARCHBLOX\n\nDetails: HttpOpenRequest failed for GET http://archblox.com/client/version.txt, Error ID: 6", "ARCHBLOX", MessageBoxButtons.OK, MessageBoxIcon.Error);
Directory.Delete(clientPath, true); DontEvenBother = true;
}
if (res == DialogResult.No)
{
label1.Text = "Cancelled install.";
DontEvenBother = true;
}
} }
if (DontEvenBother == false) if (DontEvenBother == false)
{ {
// continue with install byte[] raw = wc.DownloadData("http://archblox.com/client/version.txt");
Directory.CreateDirectory(clientPath); string webData = Encoding.UTF8.GetString(raw);
wc.DownloadFileAsync(new Uri(@"https://archblox.com/client/" + version_string + ".zip"), filePath); string version_string = webData;
progressBar1.Style = ProgressBarStyle.Blocks; string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\");
handle.WaitOne(); string clientPath = Path.Combine(folderPath, version_string + @"\");
string filePath = Path.Combine(Path.GetTempPath(),version_string + ".zip");
// setup file paths etc
{
if (Directory.Exists(folderPath))
{
// since the folder already exists, show size of folder and ask user if they want to delete older versions
DialogResult res = MessageBox.Show("Do you want to delete previous installs of ARCHBLOX? Current size of ARCHBLOX folder: " + GetDirectorySize(folderPath) + "MB.", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (res == DialogResult.Yes)
{
label1.Text = "Removing previous installs...";
Directory.Delete(folderPath, true);
}
}
}
// setup variables
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
label1.Text = "Configuring ARCHBLOX...";
if (Directory.Exists(clientPath))
{
// ask user if they want to re-install
DialogResult res = MessageBox.Show("The latest version of ARCHBLOX is already installed. Do you want to re-install it?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (res == DialogResult.Yes)
{
label1.Text = "Removing previous install...";
Directory.Delete(clientPath, true);
}
if (res == DialogResult.No)
{
label1.Text = "Cancelled install.";
DontEvenBother = true;
}
}
if (DontEvenBother == false)
{
// continue with install
Directory.CreateDirectory(clientPath);
wc.DownloadFileAsync(new Uri(@"http://archblox.com/client/" + version_string + ".zip"), filePath);
progressBar1.Style = ProgressBarStyle.Blocks;
handle.WaitOne();
} else
{
this.Hide();
this.Close();
}
} else
{
this.Hide();
this.Close();
} }
} }
private void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) private void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
@ -87,12 +104,12 @@ namespace ARCHBLOXLauncherGUI
{ {
// the download has completed, extract zip, setup URI. // the download has completed, extract zip, setup URI.
IsCompleted = true; IsCompleted = true;
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt"); byte[] raw = wc.DownloadData("http://archblox.com/client/version.txt");
string webData = Encoding.UTF8.GetString(raw); string webData = Encoding.UTF8.GetString(raw);
string version_string = webData; string version_string = webData;
string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\"); string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\");
string clientPath = Path.Combine(folderPath, version_string + @"\"); string clientPath = Path.Combine(folderPath, version_string + @"\");
string filePath = Path.Combine(clientPath, Path.GetFileName(@"https://archblox.com/client/" + version_string + ".zip")); string filePath = Path.Combine(Path.GetTempPath(), version_string + ".zip");
ZipFile.ExtractToDirectory(filePath, clientPath); ZipFile.ExtractToDirectory(filePath, clientPath);
File.Delete(filePath); File.Delete(filePath);
label1.Text = "Installing URi..."; label1.Text = "Installing URi...";
@ -109,7 +126,9 @@ namespace ARCHBLOXLauncherGUI
{ {
label1.Text = "ARCHBLOX installed without URI."; label1.Text = "ARCHBLOX installed without URI.";
} }
Thread.Sleep(1000);
this.Hide();
this.Close();
} }
} }

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. http://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. http://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. http://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>

View File

@ -1,2 +1,8 @@
## ARCHBLOXLauncher ## ARCHBLOXLauncher
A Launcher for ARCHBLOX. A Launcher for ARCHBLOX.
# Credits
p0s0: Helped out with URI
BakonBot: Binary RBXL detection
Stack Exchange members: Most of the funny methods used for a lot of things.
You: for being awesome. B)

View File

@ -19,7 +19,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyProductAttribute("ARCHBLOXLauncherGUI")] [assembly: System.Reflection.AssemblyProductAttribute("ARCHBLOXLauncherGUI")]
[assembly: System.Reflection.AssemblyTitleAttribute("ARCHBLOXLauncherGUI")] [assembly: System.Reflection.AssemblyTitleAttribute("ARCHBLOXLauncherGUI")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.7")] [assembly: System.Reflection.AssemblyVersionAttribute("2.7")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://www.github.com/thomasluigi07/ARCHBLOXLauncher")] [assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "http://www.github.com/thomasluigi07/ARCHBLOXLauncher")]
// Generated by the MSBuild WriteCodeFragment class. // Generated by the MSBuild WriteCodeFragment class.

View File

@ -1 +1 @@
e7b2af59e3d4d105d76a22845727b3b92c2ba77c bc0113f22f7454ffa2eed34d308b6d9c26a358a0

View File

@ -13,11 +13,13 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ARCHBLOXLauncherGUI")] [assembly: System.Reflection.AssemblyCompanyAttribute("ARCHBLOXLauncherGUI")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyDescriptionAttribute("ARCHBLOX Launcher")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("ARCHBLOXLauncherGUI")] [assembly: System.Reflection.AssemblyProductAttribute("ARCHBLOXLauncherGUI")]
[assembly: System.Reflection.AssemblyTitleAttribute("ARCHBLOXLauncherGUI")] [assembly: System.Reflection.AssemblyTitleAttribute("ARCHBLOXLauncherGUI")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("2.7")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://www.github.com/thomasluigi07/ARCHBLOXLauncher")]
// Generated by the MSBuild WriteCodeFragment class. // Generated by the MSBuild WriteCodeFragment class.

View File

@ -1 +1 @@
6f9d16c093487edd1e5a5cc9891c502fd7bc9069 96d1eaab556670d9b3f5c78fd41934fe1d9ac03e

View File

@ -1,9 +1,3 @@
is_global = true is_global = true
build_property.ApplicationManifest =
build_property.StartupObject =
build_property.ApplicationDefaultFont =
build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles =
build_property.RootNamespace = ARCHBLOXLauncherGUI build_property.RootNamespace = ARCHBLOXLauncherGUI
build_property.ProjectDir = C:\Users\Thomas\source\repos\ARCHBLOXLauncher1\ build_property.ProjectDir = C:\Users\Thomas\source\repos\ARCHBLOXLauncher1\