diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/EnvForm.Designer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/EnvForm.Designer.cs
index e5ee16e..8d27986 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/EnvForm.Designer.cs
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/EnvForm.Designer.cs
@@ -52,9 +52,11 @@
// groupBox1
//
this.groupBox1.Controls.Add(this.listView1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Location = new System.Drawing.Point(17, 18);
+ this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(419, 170);
+ this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.groupBox1.Size = new System.Drawing.Size(599, 255);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "User-defined variables";
@@ -65,9 +67,10 @@
this.columnHeader1,
this.columnHeader2});
this.listView1.HideSelection = false;
- this.listView1.Location = new System.Drawing.Point(16, 26);
+ this.listView1.Location = new System.Drawing.Point(23, 39);
+ this.listView1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(386, 129);
+ this.listView1.Size = new System.Drawing.Size(550, 192);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.ListView1_SelectedIndexChanged);
@@ -90,9 +93,11 @@
this.groupBox2.Controls.Add(this.textSetName);
this.groupBox2.Controls.Add(this.labelSetValue);
this.groupBox2.Controls.Add(this.labelSetName);
- this.groupBox2.Location = new System.Drawing.Point(12, 188);
+ this.groupBox2.Location = new System.Drawing.Point(17, 282);
+ this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(419, 229);
+ this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.groupBox2.Size = new System.Drawing.Size(599, 344);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Update the user-defined variable";
@@ -100,9 +105,10 @@
// checkDeleteVariable
//
this.checkDeleteVariable.AutoSize = true;
- this.checkDeleteVariable.Location = new System.Drawing.Point(31, 88);
+ this.checkDeleteVariable.Location = new System.Drawing.Point(44, 132);
+ this.checkDeleteVariable.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.checkDeleteVariable.Name = "checkDeleteVariable";
- this.checkDeleteVariable.Size = new System.Drawing.Size(131, 16);
+ this.checkDeleteVariable.Size = new System.Drawing.Size(178, 22);
this.checkDeleteVariable.TabIndex = 7;
this.checkDeleteVariable.Text = "Delete this variable";
this.checkDeleteVariable.UseVisualStyleBackColor = true;
@@ -110,9 +116,10 @@
// btnOk
//
this.btnOk.Image = global::WelsonJS.Launcher.Properties.Resources.icon_check_32;
- this.btnOk.Location = new System.Drawing.Point(303, 123);
+ this.btnOk.Location = new System.Drawing.Point(433, 184);
+ this.btnOk.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnOk.Name = "btnOk";
- this.btnOk.Size = new System.Drawing.Size(86, 86);
+ this.btnOk.Size = new System.Drawing.Size(123, 129);
this.btnOk.TabIndex = 6;
this.btnOk.Text = "Ok";
this.btnOk.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
@@ -123,11 +130,15 @@
//
this.btnOpenFile.Image = global::WelsonJS.Launcher.Properties.Resources.icon_file_32;
this.btnOpenFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.btnOpenFile.Location = new System.Drawing.Point(31, 169);
+ this.btnOpenFile.Location = new System.Drawing.Point(44, 254);
+ this.btnOpenFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnOpenFile.Name = "btnOpenFile";
- this.btnOpenFile.Size = new System.Drawing.Size(201, 40);
+ this.btnOpenFile.Padding = new System.Windows.Forms.Padding(16, 0, 0, 0);
+ this.btnOpenFile.Size = new System.Drawing.Size(287, 60);
this.btnOpenFile.TabIndex = 5;
this.btnOpenFile.Text = "Open the file...";
+ this.btnOpenFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnOpenFile.UseVisualStyleBackColor = true;
this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
//
@@ -135,43 +146,51 @@
//
this.btnOpenDirectory.Image = global::WelsonJS.Launcher.Properties.Resources.icon_directory_32;
this.btnOpenDirectory.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.btnOpenDirectory.Location = new System.Drawing.Point(31, 123);
+ this.btnOpenDirectory.Location = new System.Drawing.Point(44, 184);
+ this.btnOpenDirectory.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnOpenDirectory.Name = "btnOpenDirectory";
- this.btnOpenDirectory.Size = new System.Drawing.Size(201, 40);
+ this.btnOpenDirectory.Padding = new System.Windows.Forms.Padding(16, 0, 0, 0);
+ this.btnOpenDirectory.Size = new System.Drawing.Size(287, 60);
this.btnOpenDirectory.TabIndex = 4;
this.btnOpenDirectory.Text = "Open the directory...";
+ this.btnOpenDirectory.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.btnOpenDirectory.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnOpenDirectory.UseVisualStyleBackColor = true;
this.btnOpenDirectory.Click += new System.EventHandler(this.btnOpenDirectory_Click);
//
// textSetValue
//
- this.textSetValue.Location = new System.Drawing.Point(98, 55);
+ this.textSetValue.Location = new System.Drawing.Point(140, 82);
+ this.textSetValue.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textSetValue.Name = "textSetValue";
- this.textSetValue.Size = new System.Drawing.Size(291, 21);
+ this.textSetValue.Size = new System.Drawing.Size(414, 28);
this.textSetValue.TabIndex = 3;
//
// textSetName
//
- this.textSetName.Location = new System.Drawing.Point(98, 28);
+ this.textSetName.Location = new System.Drawing.Point(140, 42);
+ this.textSetName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textSetName.Name = "textSetName";
- this.textSetName.Size = new System.Drawing.Size(291, 21);
+ this.textSetName.Size = new System.Drawing.Size(414, 28);
this.textSetName.TabIndex = 2;
//
// labelSetValue
//
this.labelSetValue.AutoSize = true;
- this.labelSetValue.Location = new System.Drawing.Point(29, 59);
+ this.labelSetValue.Location = new System.Drawing.Point(41, 88);
+ this.labelSetValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelSetValue.Name = "labelSetValue";
- this.labelSetValue.Size = new System.Drawing.Size(61, 12);
+ this.labelSetValue.Size = new System.Drawing.Size(89, 18);
this.labelSetValue.TabIndex = 1;
this.labelSetValue.Text = "Set value:";
//
// labelSetName
//
this.labelSetName.AutoSize = true;
- this.labelSetName.Location = new System.Drawing.Point(29, 31);
+ this.labelSetName.Location = new System.Drawing.Point(41, 46);
+ this.labelSetName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelSetName.Name = "labelSetName";
- this.labelSetName.Size = new System.Drawing.Size(63, 12);
+ this.labelSetName.Size = new System.Drawing.Size(91, 18);
this.labelSetName.TabIndex = 0;
this.labelSetName.Text = "Set name:";
//
@@ -179,9 +198,11 @@
//
this.groupBox3.Controls.Add(this.btnExport);
this.groupBox3.Controls.Add(this.btnImport);
- this.groupBox3.Location = new System.Drawing.Point(12, 423);
+ this.groupBox3.Location = new System.Drawing.Point(17, 634);
+ this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(419, 89);
+ this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.groupBox3.Size = new System.Drawing.Size(599, 134);
this.groupBox3.TabIndex = 2;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Import and export";
@@ -190,9 +211,11 @@
//
this.btnExport.Image = global::WelsonJS.Launcher.Properties.Resources.icon_export_32;
this.btnExport.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.btnExport.Location = new System.Drawing.Point(213, 29);
+ this.btnExport.Location = new System.Drawing.Point(304, 44);
+ this.btnExport.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnExport.Name = "btnExport";
- this.btnExport.Size = new System.Drawing.Size(176, 40);
+ this.btnExport.Padding = new System.Windows.Forms.Padding(16, 0, 0, 0);
+ this.btnExport.Size = new System.Drawing.Size(251, 60);
this.btnExport.TabIndex = 6;
this.btnExport.Text = "Export";
this.btnExport.UseVisualStyleBackColor = true;
@@ -202,9 +225,11 @@
//
this.btnImport.Image = global::WelsonJS.Launcher.Properties.Resources.icon_import_32;
this.btnImport.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.btnImport.Location = new System.Drawing.Point(31, 29);
+ this.btnImport.Location = new System.Drawing.Point(44, 44);
+ this.btnImport.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnImport.Name = "btnImport";
- this.btnImport.Size = new System.Drawing.Size(176, 40);
+ this.btnImport.Padding = new System.Windows.Forms.Padding(16, 0, 0, 0);
+ this.btnImport.Size = new System.Drawing.Size(251, 60);
this.btnImport.TabIndex = 5;
this.btnImport.Text = "Import";
this.btnImport.UseVisualStyleBackColor = true;
@@ -212,14 +237,15 @@
//
// EnvForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(447, 529);
+ this.ClientSize = new System.Drawing.Size(639, 794);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = global::WelsonJS.Launcher.Properties.Resources.favicon;
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.Name = "EnvForm";
this.Text = "User-defined variables editor";
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.Designer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.Designer.cs
new file mode 100644
index 0000000..d2b13b6
--- /dev/null
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.Designer.cs
@@ -0,0 +1,168 @@
+namespace WelsonJS.Launcher
+{
+ partial class InstancesForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.listView1 = new System.Windows.Forms.ListView();
+ this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.btnDelete = new System.Windows.Forms.Button();
+ this.btnOpenWithExplorer = new System.Windows.Forms.Button();
+ this.checkBox2 = new System.Windows.Forms.CheckBox();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ this.btnStart = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // listView1
+ //
+ this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader2});
+ this.listView1.HideSelection = false;
+ this.listView1.Location = new System.Drawing.Point(12, 12);
+ this.listView1.Name = "listView1";
+ this.listView1.Size = new System.Drawing.Size(547, 253);
+ this.listView1.TabIndex = 0;
+ this.listView1.UseCompatibleStateImageBehavior = false;
+ this.listView1.View = System.Windows.Forms.View.Details;
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "InstanceId";
+ this.columnHeader1.Width = 220;
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "FirstDeployTime";
+ this.columnHeader2.Width = 180;
+ //
+ // btnDelete
+ //
+ this.btnDelete.Image = global::WelsonJS.Launcher.Properties.Resources.icon_delete_32;
+ this.btnDelete.Location = new System.Drawing.Point(171, 364);
+ this.btnDelete.Name = "btnDelete";
+ this.btnDelete.Size = new System.Drawing.Size(150, 60);
+ this.btnDelete.TabIndex = 2;
+ this.btnDelete.Text = "Delete";
+ this.btnDelete.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.btnDelete.UseVisualStyleBackColor = true;
+ this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
+ //
+ // btnOpenWithExplorer
+ //
+ this.btnOpenWithExplorer.Image = global::WelsonJS.Launcher.Properties.Resources.icon_directory_32;
+ this.btnOpenWithExplorer.Location = new System.Drawing.Point(327, 364);
+ this.btnOpenWithExplorer.Name = "btnOpenWithExplorer";
+ this.btnOpenWithExplorer.Size = new System.Drawing.Size(150, 60);
+ this.btnOpenWithExplorer.TabIndex = 3;
+ this.btnOpenWithExplorer.Text = "Open with Explorer";
+ this.btnOpenWithExplorer.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.btnOpenWithExplorer.UseVisualStyleBackColor = true;
+ this.btnOpenWithExplorer.Click += new System.EventHandler(this.btnOpenWithExplorer_Click);
+ //
+ // checkBox2
+ //
+ this.checkBox2.AutoSize = true;
+ this.checkBox2.Location = new System.Drawing.Point(15, 322);
+ this.checkBox2.Margin = new System.Windows.Forms.Padding(4);
+ this.checkBox2.Name = "checkBox2";
+ this.checkBox2.Size = new System.Drawing.Size(352, 22);
+ this.checkBox2.TabIndex = 9;
+ this.checkBox2.Text = "This is an Interactive Service Application";
+ this.checkBox2.UseVisualStyleBackColor = true;
+ //
+ // textBox1
+ //
+ this.textBox1.Enabled = false;
+ this.textBox1.Location = new System.Drawing.Point(284, 283);
+ this.textBox1.Margin = new System.Windows.Forms.Padding(4);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(155, 28);
+ this.textBox1.TabIndex = 8;
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Location = new System.Drawing.Point(15, 288);
+ this.checkBox1.Margin = new System.Windows.Forms.Padding(4);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(256, 22);
+ this.checkBox1.TabIndex = 7;
+ this.checkBox1.Text = "I want to use specific script ";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // btnStart
+ //
+ this.btnStart.Image = global::WelsonJS.Launcher.Properties.Resources.icon_start_32;
+ this.btnStart.Location = new System.Drawing.Point(15, 364);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(150, 60);
+ this.btnStart.TabIndex = 1;
+ this.btnStart.Text = "Start";
+ this.btnStart.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.btnStart.UseVisualStyleBackColor = true;
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ //
+ // InstancesForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(573, 444);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.listView1);
+ this.Controls.Add(this.btnDelete);
+ this.Controls.Add(this.checkBox1);
+ this.Controls.Add(this.checkBox2);
+ this.Controls.Add(this.btnOpenWithExplorer);
+ this.Controls.Add(this.textBox1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.Icon = global::WelsonJS.Launcher.Properties.Resources.favicon;
+ this.MaximizeBox = false;
+ this.Name = "InstancesForm";
+ this.Text = "Instances";
+ this.Load += new System.EventHandler(this.InstancesForm_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ListView listView1;
+ private System.Windows.Forms.Button btnDelete;
+ private System.Windows.Forms.Button btnOpenWithExplorer;
+ private System.Windows.Forms.CheckBox checkBox2;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.CheckBox checkBox1;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.Button btnStart;
+ }
+}
\ No newline at end of file
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.cs
new file mode 100644
index 0000000..abb43e1
--- /dev/null
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.cs
@@ -0,0 +1,108 @@
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WelsonJS.Launcher
+{
+ public partial class InstancesForm : Form
+ {
+ private readonly string instancesRoot = Path.GetTempPath();
+ private string entryFileName;
+ private string scriptName;
+
+ public InstancesForm()
+ {
+ InitializeComponent();
+
+ entryFileName = "bootstrap.bat";
+ }
+
+ private void InstancesForm_Load(object sender, EventArgs e)
+ {
+ LoadInstances();
+ }
+
+ private void LoadInstances()
+ {
+ listView1.Items.Clear();
+
+ if (!Directory.Exists(instancesRoot))
+ return;
+
+ foreach (string dir in Directory.GetDirectories(instancesRoot))
+ {
+ string launcherFile = Path.Combine(dir, ".welsonjs_launcher");
+
+ if (File.Exists(launcherFile))
+ {
+ string firstDeployTime = File.ReadAllText(launcherFile).Trim();
+ ListViewItem item = new ListViewItem(new[] {
+ Path.GetFileName(dir),
+ firstDeployTime
+ });
+ item.Tag = dir;
+ listView1.Items.Add(item);
+ }
+ }
+ }
+
+ private void btnStart_Click(object sender, EventArgs e)
+ {
+ if (listView1.SelectedItems.Count > 0)
+ {
+ scriptName = textBox1.Text;
+
+ string selectedInstance = listView1.SelectedItems[0].Text;
+ string workingDirectory = Path.Combine(instancesRoot, selectedInstance);
+
+ Task.Run(() =>
+ {
+ try
+ {
+ // Run the appliction
+ Program.RunCommandPrompt(workingDirectory, entryFileName, scriptName, checkBox1.Checked, checkBox2.Checked);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ });
+ }
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (listView1.SelectedItems.Count > 0)
+ {
+ string selectedInstance = listView1.SelectedItems[0].Text;
+ string workingDirectory = Path.Combine(instancesRoot, selectedInstance);
+
+ if (Directory.Exists(workingDirectory))
+ {
+ Directory.Delete(workingDirectory, true);
+ LoadInstances();
+ }
+ }
+ }
+
+ private void btnOpenWithExplorer_Click(object sender, EventArgs e)
+ {
+ if (listView1.SelectedItems.Count > 0)
+ {
+ string selectedInstance = listView1.SelectedItems[0].Text;
+ string workingDirectory = Path.Combine(instancesRoot, selectedInstance);
+
+ if (Directory.Exists(workingDirectory))
+ {
+ System.Diagnostics.Process.Start("explorer", workingDirectory);
+ }
+ }
+ }
+
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+ textBox1.Enabled = checkBox1.Checked;
+ }
+ }
+}
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.resx b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/InstancesForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.Designer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.Designer.cs
index 4ebed46..6fdadf3 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.Designer.cs
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.Designer.cs
@@ -38,15 +38,17 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.userdefinedVariablesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.instancesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Image = global::WelsonJS.Launcher.Properties.Resources.icon_zip_128;
- this.button1.Location = new System.Drawing.Point(24, 67);
+ this.button1.Location = new System.Drawing.Point(34, 100);
+ this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(200, 200);
+ this.button1.Size = new System.Drawing.Size(286, 300);
this.button1.TabIndex = 0;
this.button1.Text = "From ZIP file...";
this.button1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
@@ -56,9 +58,10 @@
// button2
//
this.button2.Image = global::WelsonJS.Launcher.Properties.Resources.icon_link_128;
- this.button2.Location = new System.Drawing.Point(230, 67);
+ this.button2.Location = new System.Drawing.Point(329, 100);
+ this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(200, 200);
+ this.button2.Size = new System.Drawing.Size(286, 300);
this.button2.TabIndex = 1;
this.button2.Text = "From external link...";
this.button2.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
@@ -68,18 +71,20 @@
// label1
//
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(24, 41);
+ this.label1.Location = new System.Drawing.Point(34, 62);
+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(312, 12);
+ this.label1.Size = new System.Drawing.Size(450, 18);
this.label1.TabIndex = 2;
this.label1.Text = "Choose the location of WelsonJS application package.";
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
- this.linkLabel1.Location = new System.Drawing.Point(24, 345);
+ this.linkLabel1.Location = new System.Drawing.Point(34, 518);
+ this.linkLabel1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.Size = new System.Drawing.Size(219, 12);
+ this.linkLabel1.Size = new System.Drawing.Size(318, 18);
this.linkLabel1.TabIndex = 3;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "https://github.com/gnh1201/welsonjs";
@@ -88,9 +93,10 @@
// checkBox1
//
this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(26, 281);
+ this.checkBox1.Location = new System.Drawing.Point(37, 422);
+ this.checkBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(184, 16);
+ this.checkBox1.Size = new System.Drawing.Size(256, 22);
this.checkBox1.TabIndex = 4;
this.checkBox1.Text = "I want to use specific script ";
this.checkBox1.UseVisualStyleBackColor = true;
@@ -99,17 +105,19 @@
// textBox1
//
this.textBox1.Enabled = false;
- this.textBox1.Location = new System.Drawing.Point(214, 278);
+ this.textBox1.Location = new System.Drawing.Point(306, 417);
+ this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(110, 21);
+ this.textBox1.Size = new System.Drawing.Size(155, 28);
this.textBox1.TabIndex = 5;
//
// checkBox2
//
this.checkBox2.AutoSize = true;
- this.checkBox2.Location = new System.Drawing.Point(26, 305);
+ this.checkBox2.Location = new System.Drawing.Point(37, 458);
+ this.checkBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(254, 16);
+ this.checkBox2.Size = new System.Drawing.Size(352, 22);
this.checkBox2.TabIndex = 6;
this.checkBox2.Text = "This is an Interactive Service Application";
this.checkBox2.UseVisualStyleBackColor = true;
@@ -120,16 +128,18 @@
this.settingsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.Size = new System.Drawing.Size(461, 24);
+ this.menuStrip1.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3);
+ this.menuStrip1.Size = new System.Drawing.Size(659, 25);
this.menuStrip1.TabIndex = 7;
this.menuStrip1.Text = "menuStrip1";
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.userdefinedVariablesToolStripMenuItem});
+ this.userdefinedVariablesToolStripMenuItem,
+ this.instancesToolStripMenuItem});
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
- this.settingsToolStripMenuItem.Size = new System.Drawing.Size(62, 20);
+ this.settingsToolStripMenuItem.Size = new System.Drawing.Size(62, 19);
this.settingsToolStripMenuItem.Text = "Settings";
//
// userdefinedVariablesToolStripMenuItem
@@ -139,11 +149,18 @@
this.userdefinedVariablesToolStripMenuItem.Text = "User-defined variables";
this.userdefinedVariablesToolStripMenuItem.Click += new System.EventHandler(this.userdefinedVariablesToolStripMenuItem_Click);
//
+ // instancesToolStripMenuItem
+ //
+ this.instancesToolStripMenuItem.Name = "instancesToolStripMenuItem";
+ this.instancesToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
+ this.instancesToolStripMenuItem.Text = "Instances";
+ this.instancesToolStripMenuItem.Click += new System.EventHandler(this.instancesToolStripMenuItem_Click);
+ //
// MainForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(461, 382);
+ this.ClientSize = new System.Drawing.Size(659, 573);
this.Controls.Add(this.checkBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.checkBox1);
@@ -155,9 +172,10 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = global::WelsonJS.Launcher.Properties.Resources.favicon;
this.MainMenuStrip = this.menuStrip1;
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.Name = "MainForm";
- this.Text = "WelsonJS.Launcher";
+ this.Text = "WelsonJS Application Launcher";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
@@ -177,6 +195,7 @@
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem userdefinedVariablesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem instancesToolStripMenuItem;
}
}
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs
index 8aa3b5c..d1d5620 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs
@@ -4,14 +4,13 @@ using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
using System.Windows.Forms;
-using System.Linq;
namespace WelsonJS.Launcher
{
public partial class MainForm : Form
{
private string workingDirectory;
- private string instanceName;
+ private string instanceId;
private string entryFileName;
private string scriptName;
@@ -67,8 +66,8 @@ namespace WelsonJS.Launcher
private void ExtractAndRun(string filePath)
{
- instanceName = Guid.NewGuid().ToString();
- workingDirectory = Path.Combine(Path.GetTempPath(), instanceName);
+ instanceId = Guid.NewGuid().ToString();
+ workingDirectory = Path.Combine(Path.GetTempPath(), instanceId);
scriptName = textBox1.Text;
Task.Run(() =>
@@ -84,11 +83,14 @@ namespace WelsonJS.Launcher
// try to extact ZIP file
ZipFile.ExtractToDirectory(filePath, workingDirectory);
+ // record the first deploy time
+ RecordFirstDeployTime(workingDirectory);
+
// If it is created the sub-directory
workingDirectory = GetFinalDirectory(workingDirectory);
// Run the appliction
- RunCommandPrompt();
+ Program.RunCommandPrompt(workingDirectory, entryFileName, scriptName, checkBox1.Checked, checkBox2.Checked);
}
catch (Exception ex)
{
@@ -104,67 +106,19 @@ namespace WelsonJS.Launcher
DisableUI();
}
- private void RunCommandPrompt()
+ private void RecordFirstDeployTime(string directory)
{
- bool isConsoleApplication = checkBox1.Checked;
- bool isInteractiveServiceAapplication = checkBox2.Checked;
+ try
+ {
+ string filePath = Path.Combine(directory, ".welsonjs_launcher");
+ string text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- if (!isConsoleApplication)
- {
- if (!File.Exists(Path.Combine(workingDirectory, entryFileName)))
- {
- throw new Exception("Not Found: " + entryFileName);
- }
+ File.WriteAllText(filePath, text);
}
- else
+ catch (Exception ex)
{
- if (!Directory.EnumerateFiles(workingDirectory, scriptName + ".*").Any())
- {
- throw new Exception("Not found matches file: " + scriptName);
- }
+ throw new Exception($"Failed to record first deploy time: {ex.Message}");
}
-
- Process process = new Process
- {
- StartInfo = new ProcessStartInfo("cmd")
- {
- UseShellExecute = false,
- RedirectStandardInput = true,
- RedirectStandardOutput = true,
- CreateNoWindow = true,
- Arguments = "/k",
- }
- };
- process.Start();
-
- process.StandardInput.WriteLine("pushd " + workingDirectory);
- process.StandardInput.WriteLine();
- process.StandardInput.Flush();
- process.StandardOutput.ReadLine();
-
- if (isInteractiveServiceAapplication)
- {
- process.StandardInput.WriteLine($"start cmd /c startInteractiveService.bat");
- process.StandardInput.WriteLine();
- process.StandardInput.Flush();
- process.StandardOutput.ReadLine();
- }
- else if (!isConsoleApplication)
- {
- process.StandardInput.WriteLine(entryFileName);
- process.StandardInput.WriteLine();
- process.StandardInput.Flush();
- process.StandardOutput.ReadLine();
- }
- else
- {
- process.StandardInput.WriteLine($"start cmd /c cscript app.js {scriptName}");
- process.StandardInput.WriteLine();
- process.StandardInput.Flush();
- process.StandardOutput.ReadLine();
- }
- process.StandardInput.Close();
- process.WaitForExit();
}
private string OpenFileDialog()
@@ -210,5 +164,10 @@ namespace WelsonJS.Launcher
{
(new EnvForm()).Show();
}
+
+ private void instancesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ (new InstancesForm()).Show();
+ }
}
}
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
index 76d9e4d..efc4656 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
@@ -1,14 +1,13 @@
using System;
-using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
using System.Windows.Forms;
namespace WelsonJS.Launcher
{
internal static class Program
{
- ///
- /// 해당 애플리케이션의 주 진입점입니다.
- ///
[STAThread]
static void Main()
{
@@ -16,5 +15,65 @@ namespace WelsonJS.Launcher
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
+
+ public static void RunCommandPrompt(string workingDirectory, string entryFileName, string scriptName, bool isConsoleApplication = true, bool isInteractiveServiceAapplication = false)
+ {
+ if (!isConsoleApplication)
+ {
+ if (!File.Exists(Path.Combine(workingDirectory, entryFileName)))
+ {
+ throw new Exception("Not Found: " + entryFileName);
+ }
+ }
+ else
+ {
+ if (!Directory.EnumerateFiles(workingDirectory, scriptName + ".*").Any())
+ {
+ throw new Exception("Not found matches file: " + scriptName);
+ }
+ }
+
+ Process process = new Process
+ {
+ StartInfo = new ProcessStartInfo("cmd")
+ {
+ UseShellExecute = false,
+ RedirectStandardInput = true,
+ RedirectStandardOutput = true,
+ CreateNoWindow = true,
+ Arguments = "/k",
+ }
+ };
+ process.Start();
+
+ process.StandardInput.WriteLine("pushd " + workingDirectory);
+ process.StandardInput.WriteLine();
+ process.StandardInput.Flush();
+ process.StandardOutput.ReadLine();
+
+ if (isInteractiveServiceAapplication)
+ {
+ process.StandardInput.WriteLine($"start cmd /c startInteractiveService.bat");
+ process.StandardInput.WriteLine();
+ process.StandardInput.Flush();
+ process.StandardOutput.ReadLine();
+ }
+ else if (!isConsoleApplication)
+ {
+ process.StandardInput.WriteLine(entryFileName);
+ process.StandardInput.WriteLine();
+ process.StandardInput.Flush();
+ process.StandardOutput.ReadLine();
+ }
+ else
+ {
+ process.StandardInput.WriteLine($"start cmd /c cscript app.js {scriptName}");
+ process.StandardInput.WriteLine();
+ process.StandardInput.Flush();
+ process.StandardOutput.ReadLine();
+ }
+ process.StandardInput.Close();
+ process.WaitForExit();
+ }
}
}
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs
index 94cd684..6a41cd2 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs
@@ -80,6 +80,16 @@ namespace WelsonJS.Launcher.Properties {
}
}
+ ///
+ /// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
+ ///
+ internal static System.Drawing.Bitmap icon_delete_32 {
+ get {
+ object obj = ResourceManager.GetObject("icon_delete_32", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
///
@@ -130,6 +140,16 @@ namespace WelsonJS.Launcher.Properties {
}
}
+ ///
+ /// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
+ ///
+ internal static System.Drawing.Bitmap icon_start_32 {
+ get {
+ object obj = ResourceManager.GetObject("icon_start_32", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
///
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx
index f7b1d8b..2167f66 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx
@@ -142,4 +142,10 @@
..\Resources\icon_import_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icon_delete_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icon_start_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_delete_32.png b/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_delete_32.png
new file mode 100644
index 0000000..b7692e4
Binary files /dev/null and b/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_delete_32.png differ
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_start_32.png b/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_start_32.png
new file mode 100644
index 0000000..22e32c4
Binary files /dev/null and b/WelsonJS.Toolkit/WelsonJS.Launcher/Resources/icon_start_32.png differ
diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/WelsonJS.Launcher.csproj b/WelsonJS.Toolkit/WelsonJS.Launcher/WelsonJS.Launcher.csproj
index 9df0a5d..58cc6c6 100644
--- a/WelsonJS.Toolkit/WelsonJS.Launcher/WelsonJS.Launcher.csproj
+++ b/WelsonJS.Toolkit/WelsonJS.Launcher/WelsonJS.Launcher.csproj
@@ -76,6 +76,12 @@
EnvForm.cs
+
+ Form
+
+
+ InstancesForm.cs
+
Form
@@ -87,6 +93,9 @@
EnvForm.cs
+
+ InstancesForm.cs
+
MainForm.cs
@@ -127,5 +136,11 @@
+
+
+
+
+
+
\ No newline at end of file