Skip to content

Commit

Permalink
Closes #112
Browse files Browse the repository at this point in the history
  • Loading branch information
david-poindexter committed Jul 19, 2016
1 parent 285519d commit fb4ec44
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Start.Designer.cs

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

34 changes: 32 additions & 2 deletions Start.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using System.Security.AccessControl;
using System.Net.Sockets;
using System.Diagnostics;
using System.Threading;
using MetroFramework.Controls;
using Microsoft.Web.Administration;
using Ionic.Zip;
Expand Down Expand Up @@ -107,6 +108,11 @@ private void cboLatestReleases_SelectedIndexChanged(object sender, EventArgs e)
}

private void btnGetLatestRelease_Click(object sender, EventArgs e)
{
GetOnlineVersion();
}

private void GetOnlineVersion()
{
ComboItem item = cboLatestReleases.SelectedItem as ComboItem;
//Process.Start(item.Name);
Expand All @@ -116,7 +122,7 @@ private void btnGetLatestRelease_Click(object sender, EventArgs e)
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
var fileName = item.Name.Split('/').Last();
var downloadDirectory = Directory.GetCurrentDirectory() + @"\Downloads\";
if (!Directory.Exists(downloadDirectory))
if (!Directory.Exists(downloadDirectory))
{
Directory.CreateDirectory(downloadDirectory);
}
Expand All @@ -143,6 +149,7 @@ private void btnGetLatestRelease_Click(object sender, EventArgs e)
txtLocalInstallPackage.Text = Directory.GetCurrentDirectory() + "\\Downloads\\" + Path.GetFileName(item.Name);
Properties.Settings.Default.LocalInstallPackageRecent = downloadDirectory;
Properties.Settings.Default.Save();
ValidateInstallPackage();
}
}

Expand All @@ -157,10 +164,11 @@ private void client_DownloadProgressChanged(object sender, DownloadProgressChang
void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
ComboItem item = cboLatestReleases.SelectedItem as ComboItem;
MessageBox.Show("Download Completed", "Install Package Download", MessageBoxButtons.OK, MessageBoxIcon.Information);
//MessageBox.Show("Download Completed", "Install Package Download", MessageBoxButtons.OK, MessageBoxIcon.Information);
txtLocalInstallPackage.Text = Directory.GetCurrentDirectory() + @"\Downloads\" + Path.GetFileName(item.Name);
Properties.Settings.Default.LocalInstallPackageRecent = Directory.GetCurrentDirectory() + @"\Downloads\";
Properties.Settings.Default.Save();
ValidateInstallPackage();
}

private void btnViewAllReleases_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -194,6 +202,28 @@ private void openFileDiag()
}

private void btnInstallPackageNext_Click(object sender, EventArgs e)
{
if (txtLocalInstallPackage.Text == "")
{
GetOnlineVersion();
}
else
{
DialogResult result = MessageBox.Show("Local Install Package already defined. Use it?",
"Use Local Install Package", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.No)
{
GetOnlineVersion();
}
else
{
progressBarDownload.Visible = false;
ValidateInstallPackage();
}
}
}

private void ValidateInstallPackage()
{
if (Package.Validate(txtLocalInstallPackage.Text))
{
Expand Down

0 comments on commit fb4ec44

Please sign in to comment.