it can actually download now
This commit is contained in:
parent
6cf74697a6
commit
7e3c45d9ba
|
|
@ -75,9 +75,9 @@
|
|||
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.pictureBox2.Image = global::ARCHBLOXBootstrapper.Properties.Resources.archblox;
|
||||
this.pictureBox2.InitialImage = global::ARCHBLOXBootstrapper.Properties.Resources.archblox;
|
||||
this.pictureBox2.Location = new System.Drawing.Point(3, 12);
|
||||
this.pictureBox2.Location = new System.Drawing.Point(3, 6);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(51, 52);
|
||||
this.pictureBox2.Size = new System.Drawing.Size(46, 46);
|
||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox2.TabIndex = 0;
|
||||
this.pictureBox2.TabStop = false;
|
||||
|
|
@ -85,22 +85,24 @@
|
|||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(60, 12);
|
||||
this.label2.Location = new System.Drawing.Point(55, 6);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(174, 20);
|
||||
this.label2.Size = new System.Drawing.Size(144, 15);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Configuring ARCHBLOX...";
|
||||
//
|
||||
// progressBar2
|
||||
//
|
||||
this.progressBar2.Location = new System.Drawing.Point(60, 35);
|
||||
this.progressBar2.Location = new System.Drawing.Point(55, 29);
|
||||
this.progressBar2.MarqueeAnimationSpeed = 10;
|
||||
this.progressBar2.Name = "progressBar2";
|
||||
this.progressBar2.Size = new System.Drawing.Size(252, 29);
|
||||
this.progressBar2.Size = new System.Drawing.Size(217, 23);
|
||||
this.progressBar2.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
|
||||
this.progressBar2.TabIndex = 2;
|
||||
//
|
||||
// ARCHBLOX
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(317, 72);
|
||||
this.ClientSize = new System.Drawing.Size(286, 59);
|
||||
this.Controls.Add(this.progressBar2);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.pictureBox2);
|
||||
|
|
@ -109,7 +111,7 @@
|
|||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ARCHBLOX";
|
||||
this.Text = "ARCHBLOX";
|
||||
this.Text = "ARCHBLOX Installer";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
|
|
|||
36
Form1.cs
36
Form1.cs
|
|
@ -1,37 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Data;
|
||||
using System.IO.Compression;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using System.DirectoryServices;
|
||||
using System.Windows.Forms;
|
||||
namespace ARCHBLOXBootstrapper
|
||||
{
|
||||
public partial class ARCHBLOX : Form
|
||||
{
|
||||
WebClient client;
|
||||
private static WebClient wc = new WebClient();
|
||||
private static ManualResetEvent handle = new ManualResetEvent(true);
|
||||
|
||||
public ARCHBLOX()
|
||||
{
|
||||
InitializeComponent();
|
||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
|
||||
progressBar2.Style = ProgressBarStyle.Marquee;
|
||||
label2.Text = "Configuring ARCHBLOX...";
|
||||
wc.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||
wc.DownloadFileCompleted += Client_DownloadFileCompleted;
|
||||
string fileName = System.IO.Path.GetFileName(@"https://archblox.com/img/ARCHBLOXarched.png");
|
||||
string folderPath = Path.Combine(@"%LocalAppData%", @"\ARCHBLOX\");
|
||||
string filePath = Path.Combine(folderPath, "test.png");
|
||||
Directory.CreateDirectory(folderPath);
|
||||
wc.DownloadFileAsync(new Uri(@"https://archblox.com/img/ARCHBLOXarched.png"), filePath);
|
||||
progressBar2.Style = ProgressBarStyle.Blocks;
|
||||
handle.WaitOne();
|
||||
}
|
||||
|
||||
private void ARCHBLOX_Load(object sender, EventArgs e)
|
||||
{
|
||||
client = new WebClient();
|
||||
client.DownloadProgressChanged += Client_DownloadProgressChanged;
|
||||
client.DownloadFileCompleted += Client_DownloadFileCompleted;
|
||||
label2.Text = "Configuring ARCHBLOX...";
|
||||
Uri uri = new Uri("https://archblox.com/img/ARCHBLOXarched.png");
|
||||
string fileName = System.IO.Path.GetFileName(uri.AbsolutePath);
|
||||
client.DownloadFile(uri, Application.StartupPath + "/" + fileName);
|
||||
// nothing
|
||||
}
|
||||
private void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("ARCHBLOX has been successfully installed!", "yay!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
label2.Text = "ARCHBLOX has been installed!";
|
||||
handle.WaitOne();
|
||||
}
|
||||
|
||||
private void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||
|
|
@ -40,8 +54,8 @@ namespace ARCHBLOXBootstrapper
|
|||
double receive = double.Parse(e.BytesReceived.ToString());
|
||||
double total = double.Parse(e.TotalBytesToReceive.ToString());
|
||||
double percentage = receive / total * 100;
|
||||
label2.Text = "Installing ARCHBLOX...";
|
||||
label2.Text = "Installing ARCHBLOX... (" + Math.Truncate(percentage).ToString() + "% Completed)";
|
||||
progressBar2.Value = int.Parse(Math.Truncate(percentage).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,5 +79,15 @@ 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 zunethemebar {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("zunethemebar", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 261 B |
Loading…
Reference in New Issue