Skip to content

Commit

Permalink
Merge branch 'release/2.1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Mar 8, 2016
2 parents 2cc8bd0 + 2673e9f commit b242dea
Show file tree
Hide file tree
Showing 164 changed files with 14,228 additions and 168 deletions.
141 changes: 42 additions & 99 deletions AEMManager/AEMManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
Expand Down Expand Up @@ -178,6 +179,46 @@
<Content Include="icons\aem.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="resources\iconset_inv_num\0.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\1.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\2.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\3.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\4.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\5.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\6.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\7.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\8.ico" />
<EmbeddedResource Include="resources\iconset_inv_num\9.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\0.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\1.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\2.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\3.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\4.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\5.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\6.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\7.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\8.ico" />
<EmbeddedResource Include="resources\iconset_inv_q\9.ico" />
<EmbeddedResource Include="resources\iconset_num\0.ico" />
<EmbeddedResource Include="resources\iconset_num\1.ico" />
<EmbeddedResource Include="resources\iconset_num\2.ico" />
<EmbeddedResource Include="resources\iconset_num\3.ico" />
<EmbeddedResource Include="resources\iconset_num\4.ico" />
<EmbeddedResource Include="resources\iconset_num\5.ico" />
<EmbeddedResource Include="resources\iconset_num\6.ico" />
<EmbeddedResource Include="resources\iconset_num\7.ico" />
<EmbeddedResource Include="resources\iconset_num\8.ico" />
<EmbeddedResource Include="resources\iconset_num\9.ico" />
<EmbeddedResource Include="resources\iconset_q\0.ico" />
<EmbeddedResource Include="resources\iconset_q\1.ico" />
<EmbeddedResource Include="resources\iconset_q\2.ico" />
<EmbeddedResource Include="resources\iconset_q\3.ico" />
<EmbeddedResource Include="resources\iconset_q\4.ico" />
<EmbeddedResource Include="resources\iconset_q\5.ico" />
<EmbeddedResource Include="resources\iconset_q\6.ico" />
<EmbeddedResource Include="resources\iconset_q\7.ico" />
<EmbeddedResource Include="resources\iconset_q\8.ico" />
<EmbeddedResource Include="resources\iconset_q\9.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="icons\log.ico">
Expand All @@ -191,105 +232,6 @@
<EmbeddedResource Include="resources\overlay\trayicon_running.ico" />
<EmbeddedResource Include="resources\overlay\trayicon_starting.ico" />
<EmbeddedResource Include="resources\overlay\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num1\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num1\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num1\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num1\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num1\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num2\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num2\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num2\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num2\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num2\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num3\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num3\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num3\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num3\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num3\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num4\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num4\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num4\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num4\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num4\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num5\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num5\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num5\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num5\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num5\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num6\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num6\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num6\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num6\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num6\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num7\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num7\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num7\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num7\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num7\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num8\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num8\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num8\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num8\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num8\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\inv_num9\trayicon_default.ico" />
<EmbeddedResource Include="resources\inv_num9\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\inv_num9\trayicon_running.ico" />
<EmbeddedResource Include="resources\inv_num9\trayicon_starting.ico" />
<EmbeddedResource Include="resources\inv_num9\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num9\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num9\trayicon_running.ico" />
<EmbeddedResource Include="resources\num9\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num9\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num9\trayicon_default.ico" />
<EmbeddedResource Include="resources\num8\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num8\trayicon_running.ico" />
<EmbeddedResource Include="resources\num8\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num8\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num8\trayicon_default.ico" />
<EmbeddedResource Include="resources\num7\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num7\trayicon_running.ico" />
<EmbeddedResource Include="resources\num7\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num7\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num7\trayicon_default.ico" />
<EmbeddedResource Include="resources\num6\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num6\trayicon_running.ico" />
<EmbeddedResource Include="resources\num6\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num6\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num6\trayicon_default.ico" />
<EmbeddedResource Include="resources\num5\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num5\trayicon_running.ico" />
<EmbeddedResource Include="resources\num5\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num5\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num5\trayicon_default.ico" />
<EmbeddedResource Include="resources\num4\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num4\trayicon_running.ico" />
<EmbeddedResource Include="resources\num4\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num4\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num4\trayicon_default.ico" />
<EmbeddedResource Include="resources\num3\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num3\trayicon_running.ico" />
<EmbeddedResource Include="resources\num3\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num3\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num3\trayicon_default.ico" />
<EmbeddedResource Include="resources\num2\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num2\trayicon_running.ico" />
<EmbeddedResource Include="resources\num2\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num2\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num2\trayicon_default.ico" />
<None Include="resources\num_examples\test3.ico" />
<None Include="resources\num_examples\test4.ico" />
<None Include="resources\num_examples\test5.ico" />
<None Include="resources\num_examples\test6.ico" />
<None Include="resources\num_examples\test9.ico" />
<None Include="resources\num_examples\test8.ico" />
<None Include="resources\num_examples\test7.ico" />
<None Include="resources\num_examples\test2.ico" />
<None Include="resources\num_examples\test1.ico" />
<EmbeddedResource Include="resources\num1\trayicon_starting.ico" />
<EmbeddedResource Include="resources\num1\trayicon_running.ico" />
<EmbeddedResource Include="resources\num1\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\num1\trayicon_unknown.ico" />
<EmbeddedResource Include="resources\num1\trayicon_default.ico" />
<EmbeddedResource Include="resources\default\trayicon_disabled.ico" />
<EmbeddedResource Include="resources\default\trayicon_unknown.ico" />
</ItemGroup>
Expand All @@ -310,6 +252,7 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
33 changes: 27 additions & 6 deletions AEMManager/AemActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Net.Sockets;
using System.Diagnostics;
using System.Threading;
using System.Management;
using Microsoft.Win32;
using AEMManager.Util;

Expand Down Expand Up @@ -154,13 +155,10 @@ public static void AddControlMenuItems(Menu.MenuItemCollection pParent, AemInsta
item.Click += new EventHandler(ControlStopInstance);
menuItems.Add(item);

/*
-- this does not work yet, disabled --
item = new MenuItem();
item.Text = "Kill instance";
item.Click += new EventHandler(ControlKillInstance);
menuItems.Add(item);
*/

foreach (MenuItem i in menuItems) {
i.Tag = pInstance;
Expand Down Expand Up @@ -339,13 +337,36 @@ private static void ControlKillInstance(object sender, EventArgs e) {
}

Process process = instance.GetInstanceJavaProcess();
if (process != null && !process.HasExited) {
mLog.Debug("Killing process for instance " + instance.Name);
process.Kill();
if (process != null) {
KillProcessAndChildrens(process.Id, instance);
}

}

private static void KillProcessAndChildrens(int pid, AemInstance instance) {
ManagementObjectSearcher processSearcher = new ManagementObjectSearcher
("Select * From Win32_Process Where ParentProcessID=" + pid);
ManagementObjectCollection processCollection = processSearcher.Get();

try {
Process proc = Process.GetProcessById(pid);
if (proc != null && !proc.HasExited) {
mLog.Debug("Killing process #" + pid + " for instance " + instance.Name);
proc.Kill();
}
}
catch (ArgumentException) {
// Process already exited.
}

if (processCollection != null) {
foreach (ManagementObject mo in processCollection) {
// kill child processes(also kills childrens of childrens etc.)
KillProcessAndChildrens(Convert.ToInt32(mo["ProcessID"]), instance);
}
}
}

private static Process ExecuteCommand(string pWorkDir, string pExecutable, string pArguments, string pProcessName,
bool pShowInstanceWindow, string pIconFile, bool pProcessNameViaShortcut, AemInstance pAemInstance) {
mLog.Info("Execute: WorkDir=" + pWorkDir + ", executable=" + pExecutable + ", arguments=" + pArguments);
Expand Down
6 changes: 6 additions & 0 deletions AEMManager/AemInstanceDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ private void AemInstanceDialog_Load(object sender, EventArgs e) {
else if (iconset.ToString().StartsWith("INV_NUM")) {
name = "Number #" + iconset.ToString().Substring(7) + " (inverted)";
}
else if (iconset.ToString().StartsWith("Q")) {
name = "Square #" + iconset.ToString().Substring(1);
}
else if (iconset.ToString().StartsWith("INV_Q")) {
name = "Square #" + iconset.ToString().Substring(5) + " (inverted)";
}
cboIconSet.Items.Add(new KeyValuePair<string, IconSet>(name, iconset));
if (iconset == mInstance.IconSet) {
selectedIconSet = i;
Expand Down
Loading

0 comments on commit b242dea

Please sign in to comment.