its now a studio launcher wtf!
|
|
@ -8,7 +8,15 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<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>
|
||||
|
|
|
|||
3182
Form1.resx
|
|
@ -1,23 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IWshRuntimeLibrary;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Data;
|
||||
using System.IO.Compression;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Security.Permissions;
|
||||
using Microsoft.Win32;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using System.DirectoryServices;
|
||||
using System.Windows.Forms;
|
||||
namespace ARCHBLOXBootstrapper
|
||||
{
|
||||
|
||||
{
|
||||
public partial class ARCHBLOX : Form
|
||||
{
|
||||
public bool IsCompleted = false;
|
||||
|
|
@ -25,25 +17,46 @@ namespace ARCHBLOXBootstrapper
|
|||
private static WebClient wc = new WebClient();
|
||||
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()
|
||||
{
|
||||
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 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 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);
|
||||
if (res == DialogResult.Yes)
|
||||
{
|
||||
label2.Text = "Removing previous installs...";
|
||||
Directory.Delete(folderPath, true);
|
||||
|
||||
}
|
||||
label1.Text = "Removing previous installs...";
|
||||
Directory.Delete(folderPath, true);
|
||||
}
|
||||
}
|
||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||
|
|
@ -52,26 +65,10 @@ namespace ARCHBLOXBootstrapper
|
|||
label2.Text = "Configuring ARCHBLOX...";
|
||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
handle.WaitOne();
|
||||
}
|
||||
|
|
@ -86,15 +83,25 @@ namespace ARCHBLOXBootstrapper
|
|||
if (IsCompleted == false)
|
||||
{
|
||||
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 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 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);
|
||||
File.Delete(filePath);
|
||||
label2.Text = "ARCHBLOX has been installed!";
|
||||
System.IO.File.Delete(filePath);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 |