Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Importing existing files support added and working
Browse files Browse the repository at this point in the history
  • Loading branch information
noahc3 committed Jul 2, 2018
1 parent 9b1b3ba commit fea97ad
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 85 deletions.
26 changes: 20 additions & 6 deletions auto h-encore/Form1.Designer.cs

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

47 changes: 39 additions & 8 deletions auto h-encore/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
namespace auto_h_encore {
public partial class Form1 : Form {

private static string[] imports = new string[4];

public Form1() {
InitializeComponent();

Expand Down Expand Up @@ -51,16 +53,37 @@ private void generateDirectories(string AID) {
}

private void downloadFiles() {
Utility.DownloadFile(this, true, Reference.url_hencore, Reference.path_downloads + "hencore.zip");
if (imports[0] != "") {
Utility.ImportFile(this, true, imports[0], Reference.path_downloads + "hencore.zip");
} else {
Utility.DownloadFile(this, true, Reference.url_hencore, Reference.path_downloads + "hencore.zip");
}
Utility.ExtractFile(this, true, Reference.path_downloads + "hencore.zip", Reference.path_hencore);

Utility.DownloadFile(this, true, Reference.url_psvimgtools, Reference.path_downloads + "psvimgtools.zip");

if (imports[1] != "") {
Utility.ImportFile(this, true, imports[1], Reference.path_downloads + "pkg2zip.zip");
} else {
Utility.DownloadFile(this, true, Reference.url_pkg2zip, Reference.path_downloads + "pkg2zip.zip");
}
Utility.ExtractFile(this, true, Reference.path_downloads + "pkg2zip.zip", Reference.path_pkg2zip);

if (imports[2] != "") {
Utility.ImportFile(this, true, imports[2], Reference.path_downloads + "psvimgtools.zip");
} else {
Utility.DownloadFile(this, true, Reference.url_psvimgtools, Reference.path_downloads + "psvimgtools.zip");
}
Utility.ExtractFile(this, true, Reference.path_downloads + "psvimgtools.zip", Reference.path_psvimgtools);

if (imports[3] != "") {
Utility.ImportFile(this, true, imports[3], Reference.path_downloads + "bittersmile.pkg");
} else {
Utility.DownloadFile(this, true, Reference.url_bittersmile, Reference.path_downloads + "bittersmile.pkg");
}


Utility.DownloadFile(this, true, Reference.url_pkg2zip, Reference.path_downloads + "pkg2zip.zip");
Utility.ExtractFile(this, true, Reference.path_downloads + "pkg2zip.zip", Reference.path_pkg2zip);

Utility.DownloadFile(this, true, Reference.url_bittersmile, Reference.path_downloads + "bittersmile.pkg");


}

private void PackageHencore(string encKey) {
Expand Down Expand Up @@ -108,8 +131,8 @@ private void btnStart_Click(object sender, EventArgs e) {
try {
generateDirectories(txtAID.Text);
downloadFiles();
} catch (Exception ex) {
MessageBox.Show(ex.Message);
} catch (Exception) {
//MessageBox.Show(ex.Message);
toggleControls(true);
return;
}
Expand Down Expand Up @@ -268,5 +291,13 @@ private void btnBrowseQCMA_Click(object sender, EventArgs e) {
private void txtQCMA_TextChanged(object sender, EventArgs e) {
VerifyUserInfo();
}

private void btnImport_Click(object sender, EventArgs e) {
FormFiles frm = new FormFiles(imports);
frm.ShowDialog();
if (frm.result != null) {
imports = frm.result;
}
}
}
}
66 changes: 36 additions & 30 deletions auto h-encore/FormFiles.Designer.cs

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

Loading

0 comments on commit fea97ad

Please sign in to comment.