its now a studio launcher wtf!
|
|
@ -8,7 +8,15 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Resources\archblox.ico" />
|
<COMReference Include="IWshRuntimeLibrary">
|
||||||
|
<WrapperTool>tlbimp</WrapperTool>
|
||||||
|
<VersionMinor>0</VersionMinor>
|
||||||
|
<VersionMajor>1</VersionMajor>
|
||||||
|
<Guid>f935dc20-1cf0-11d0-adb9-00c04fd58a0b</Guid>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<Isolated>false</Isolated>
|
||||||
|
<EmbedInteropTypes>true</EmbedInteropTypes>
|
||||||
|
</COMReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
3182
Form1.resx
|
|
@ -1,23 +1,15 @@
|
||||||
using System;
|
using IWshRuntimeLibrary;
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Data;
|
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Security.Permissions;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.DirectoryServices;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
namespace ARCHBLOXBootstrapper
|
namespace ARCHBLOXBootstrapper
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class ARCHBLOX : Form
|
public partial class ARCHBLOX : Form
|
||||||
{
|
{
|
||||||
public bool IsCompleted = false;
|
public bool IsCompleted = false;
|
||||||
|
|
@ -25,25 +17,46 @@ namespace ARCHBLOXBootstrapper
|
||||||
private static WebClient wc = new WebClient();
|
private static WebClient wc = new WebClient();
|
||||||
private static ManualResetEvent handle = new ManualResetEvent(true);
|
private static ManualResetEvent handle = new ManualResetEvent(true);
|
||||||
|
|
||||||
|
private void CreateShortcut()
|
||||||
|
{
|
||||||
|
object shDesktop = (object)"Desktop";
|
||||||
|
WshShell shell = new WshShell();
|
||||||
|
string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"\ARCHBLOX Studio.lnk";
|
||||||
|
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
|
||||||
|
shortcut.Description = "ARCHBLOX Studio";
|
||||||
|
shortcut.TargetPath = Path.GetFullPath(Application.ExecutablePath);
|
||||||
|
shortcut.Save();
|
||||||
|
}
|
||||||
|
|
||||||
public ARCHBLOX()
|
public ARCHBLOX()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt");
|
byte[] raw = wc.DownloadData("https://archblox.com/studio/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\", @"Studio\", @"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(clientPath, Path.GetFileName(@"https://archblox.com/client/" + version_string + ".zip"));
|
||||||
|
string studioPath = Path.Combine(clientPath, "ArchbloxStudio.exe");
|
||||||
|
if (Directory.Exists(clientPath) & System.IO.File.Exists(studioPath))
|
||||||
{
|
{
|
||||||
if (Directory.Exists(folderPath))
|
CreateShortcut();
|
||||||
|
var pProcess = new Process();
|
||||||
|
pProcess.StartInfo.FileName = studioPath;
|
||||||
|
pProcess.StartInfo.UseShellExecute = false;
|
||||||
|
pProcess.StartInfo.RedirectStandardOutput = true;
|
||||||
|
pProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
|
||||||
|
pProcess.StartInfo.CreateNoWindow = false;
|
||||||
|
pProcess.Start();
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
if (Directory.Exists(folderPath))
|
||||||
|
{
|
||||||
|
DialogResult res = MessageBox.Show("Do you want to delete previous installs of ARCHBLOX Studio?", "ARCHBLOX Studio", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
|
if (res == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
DialogResult res = MessageBox.Show("Do you want to delete previous installs of ARCHBLOX?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
label1.Text = "Removing previous installs...";
|
||||||
if (res == DialogResult.Yes)
|
Directory.Delete(folderPath, true);
|
||||||
{
|
|
||||||
label2.Text = "Removing previous installs...";
|
|
||||||
Directory.Delete(folderPath, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||||
|
|
@ -52,26 +65,10 @@ namespace ARCHBLOXBootstrapper
|
||||||
label2.Text = "Configuring ARCHBLOX...";
|
label2.Text = "Configuring ARCHBLOX...";
|
||||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||||
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
|
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
|
||||||
if (Directory.Exists(clientPath))
|
|
||||||
{
|
|
||||||
DialogResult res = MessageBox.Show("The latest version of ARCHBLOX is already installed. Do you want to re-install it?", "ARCHBLOX", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
||||||
if (res == DialogResult.Yes)
|
|
||||||
{
|
|
||||||
label2.Text = "Removing previous install...";
|
|
||||||
Directory.Delete(clientPath, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (res == DialogResult.No)
|
|
||||||
{
|
|
||||||
label2.Text = "Cancelled install.";
|
|
||||||
DontEvenBother = true;
|
|
||||||
Application.Exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DontEvenBother == false)
|
if (DontEvenBother == false)
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(clientPath);
|
Directory.CreateDirectory(clientPath);
|
||||||
wc.DownloadFileAsync(new Uri(@"https://archblox.com/client/" + version_string + ".zip"), filePath);
|
wc.DownloadFileAsync(new Uri(@"https://archblox.com/studio/" + version_string + ".zip"), filePath);
|
||||||
progressBar2.Style = ProgressBarStyle.Blocks;
|
progressBar2.Style = ProgressBarStyle.Blocks;
|
||||||
handle.WaitOne();
|
handle.WaitOne();
|
||||||
}
|
}
|
||||||
|
|
@ -86,15 +83,25 @@ namespace ARCHBLOXBootstrapper
|
||||||
if (IsCompleted == false)
|
if (IsCompleted == false)
|
||||||
{
|
{
|
||||||
IsCompleted = true;
|
IsCompleted = true;
|
||||||
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt");
|
byte[] raw = wc.DownloadData("https://archblox.com/studio/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\", @"Studio\", @"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(clientPath, Path.GetFileName(@"https://archblox.com/studio/" + version_string + ".zip"));
|
||||||
|
string studioPath = Path.Combine(clientPath, "ArchbloxStudio.exe");
|
||||||
ZipFile.ExtractToDirectory(filePath, clientPath);
|
ZipFile.ExtractToDirectory(filePath, clientPath);
|
||||||
File.Delete(filePath);
|
System.IO.File.Delete(filePath);
|
||||||
label2.Text = "ARCHBLOX has been installed!";
|
label2.Text = "ARCHBLOX Studio has been installed!";
|
||||||
|
CreateShortcut();
|
||||||
|
var pProcess = new Process();
|
||||||
|
pProcess.StartInfo.FileName = studioPath;
|
||||||
|
pProcess.StartInfo.UseShellExecute = false;
|
||||||
|
pProcess.StartInfo.RedirectStandardOutput = true;
|
||||||
|
pProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
|
||||||
|
pProcess.StartInfo.CreateNoWindow = false;
|
||||||
|
pProcess.Start();
|
||||||
|
Environment.Exit(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,25 +69,5 @@ namespace ARCHBLOXBootstrapper.Properties {
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap archblox1 {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("archblox1", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap zunethemebar {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("zunethemebar", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 261 B |