Permalink
Browse files

Fixed Python and TCPView installer

Added installer for JabberNet, OpenFire, Spark and WireShark.cs
Added PoC script for JabberNet
  • Loading branch information...
1 parent df3d397 commit 68c1c07cad6df90585ebf44566a386c1ecdca0d2 @DinisCruz DinisCruz committed Jun 10, 2013
View
43 3rdParty/JabberNet/JabberNet_Installer.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+using O2.XRules.Database.APIs;
+
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class Launcher
+ {
+ public static void launch()
+ {
+ new JabberNet_Installer().start();
+ }
+ }
+ public class JabberNet_Installer : Tool_API
+ {
+
+ public JabberNet_Installer()
+ {
+ config("JabberNet",
+ "https://jabber-net.googlecode.com/files/JabberNet.Mono.v2.1.0.710.zip".uri(),
+ "jabber-net.dll");
+
+ installFromZip_Web();
+ }
+
+ public Process start()
+ {
+ if (isInstalled())
+ {
+
+ //this.Executable.startProcess();
+ //"http://localhost:9090".startProcess();
+ }
+ return null;
+ }
+ }
+}
View
87 3rdParty/JabberNet/PoC - JabberNet - Join Room and Send IM Message to OpenFire.h2
@@ -0,0 +1,87 @@
+//var credentialsFile = @"..\_UserData\TestAccounts.xml".inTempDir();
+//var account = credentialsFile.credential("OpenFileClient");
+var userName = "o2_user";
+var password = "aaaaa";
+
+var firstMessage = "Hello room";
+var serverName = "win-fgnq5aarj8o";
+var roomName = "hubot";
+
+var jabberClient = new JabberClient()
+ {
+ Server = "localhost",
+ Port = 5222,
+ User = userName,
+ Password = password,
+ AutoStartTLS = false
+ };
+
+var conferenceManager = new ConferenceManager
+ {
+ Stream = jabberClient
+ };
+
+var jid = new JID(roomName, "conference."+serverName,userName);
+var room = conferenceManager.GetRoom(jid);
+
+
+//var topPanel = panel.add_Panel(true);
+var topPanel = "Jabber Test".popupWindow()
+ .insert_LogViewer();
+var treeView = topPanel.add_TreeView();
+
+Action<string,string> showMessage =
+ (from,text) =>{
+ var nodeText = "{0}: {1}: {2}".format(DateTime.Now.ToShortTimeString(), from,text);
+ treeView.add_Node(nodeText).selected();
+ };
+
+Action<string> sendPublicMessage =
+ (text)=>{
+ room.PublicMessage(text);
+ showMessage(userName, text);
+ };
+
+room.OnJoin += (r)=>
+ {
+ treeView.white();
+ sendPublicMessage(firstMessage);
+ };
+room.OnRoomMessage+= (sender,message)=>
+ {
+ "[OnRoomMessage] {0}".info(message);
+ showMessage(message.From.User, message.Body);
+ };
+
+Action onAuthenticate =
+ ()=>{
+ "[OnAuthenticate]".info();
+ room.Join();
+ };
+Action onConnect =
+ ()=>{
+ "[OnConnect]".info();
+ //O2Thread.mtaThread(()=>jabberClient.Login()); // this wasn't working all the time
+ };
+
+jabberClient.OnConnect += (sender,stream)=> onConnect();
+jabberClient.OnAuthenticate += (sender)=> onAuthenticate();
+
+topPanel.insert_Above(20).add_LabelAndComboBoxAndButton("Message","","Send",sendPublicMessage);
+
+treeView.pink();
+
+jabberClient.Connect();
+
+200.wait();
+jabberClient.Login(); // have to trigger this from here
+
+
+//var state = (BaseState)jabberClient.property("State");
+return "done";
+
+//using jabber;
+//using jabber.client
+//using jabber.connection
+//Installer:JabberNet_Installer.cs!JabberNet/jabber-net.dll
+//O2Ref:JabberNet/jabber-net.dll
View
42 3rdParty/_Installers/OpenFire.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+using O2.XRules.Database.APIs;
+
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class Launcher
+ {
+ public static void launch()
+ {
+ new OpenFire_Installer().start();
+ }
+ }
+ public class OpenFire_Installer : Tool_API
+ {
+
+ public OpenFire_Installer()
+ {
+ config("OpenFire",
+ "http://download.igniterealtime.org/openfire/openfire_3_8_2.zip".uri(),
+ "openfire/bin/openfire.exe");
+
+ installFromZip_Web();
+ }
+
+ public Process start()
+ {
+ if (isInstalled())
+ {
+ this.Executable.startProcess();
+ "http://localhost:9090".startProcess();
+ }
+ return null;
+ }
+ }
+}
View
14 3rdParty/_Installers/Python_2.7.cs
@@ -20,13 +20,13 @@ public class Python_Install : Tool_API
{
public Python_Install()
{
- Install_Uri = "http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi".uri();
- Install_File = "python-2.7.3.msi";
- Install_Dir = @"C:\Python27\";
- Executable = Install_Dir.pathCombine("python.exe");
- startInstaller_FromMsi_Web();
- }
- //
+ config("Python-2.7",
+ "http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi".uri(),
+ @"C:\Python27\python.exe");
+
+ startInstaller_FromMsi_Web();
+
+ }
public Process start()
{
View
37 3rdParty/_Installers/Python_3.3.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class testInstall
+ {
+ public static void test()
+ {
+ new Python_Install().start();
+ }
+ }
+
+ public class Python_Install : Tool_API
+ {
+ public Python_Install()
+ {
+ config("Python",
+ "http://www.python.org/ftp/python/3.3.2/python-3.3.2.msi".uri(),
+ @"C:\Python33\python.exe");
+
+ startInstaller_FromMsi_Web();
+ }
+
+ public Process start()
+ {
+ if (this.isInstalled())
+ return this.Executable.startProcess();
+ return null;
+ }
+ }
+}
View
40 3rdParty/_Installers/Spark.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+using O2.XRules.Database.APIs;
+
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class Launcher
+ {
+ public static void launch()
+ {
+ new Spark_Installer().start();
+ }
+ }
+ public class Spark_Installer : Tool_API
+ {
+
+ public Spark_Installer()
+ {
+ config("Spark",
+ "http://download.igniterealtime.org/spark/spark_2_6_3.exe".uri(),
+ //"http://download.igniterealtime.org/spark/online/spark_2_6_3_online.exe".uri(),
+ ProgramFilesFolder.pathCombine(@"Spark\\Spark.exe"));
+
+ installFromExe_Web();
+ }
+
+ public Process start()
+ {
+ if (isInstalled())
+ this.Executable.startProcess();
+ return null;
+ }
+ }
+}
View
22 3rdParty/_Installers/TCPView.cs
@@ -24,23 +24,21 @@ public TcpView() : this(true)
public TcpView(bool installNow)
{
- config("TcpView", "TcpView v3.05", "TCPView.zip");
+ config("TcpView",
+ "http://download.sysinternals.com/files/TCPView.zip".uri(),
+ @"tcpview.exe");
+ installFromZip_Web();
+
+ /*config("TcpView", "TcpView v3.05", "TCPView.zip");
Install_Uri = "http://download.sysinternals.com/files/TCPView.zip".uri();
if (installNow)
- install();
+ install(); */
}
-
-
- public bool install()
- {
- "Installing {0}".info(ToolName);
- return installFromZip_Web();
- }
-
+
public Process start()
{
- if (install())
- return Install_Dir.pathCombine("tcpview.exe").startProcess();
+ if (isInstalled())
+ return this.Executable.startProcess();
return null;
}
}
View
38 3rdParty/_Installers/WireShark.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Diagnostics;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.Utils;
+//O2File:Tool_API.cs
+
+namespace O2.XRules.Database.APIs
+{
+ public class testInstall
+ {
+ public static void test()
+ {
+ new Python_Install().start();
+ }
+ }
+
+ public class Python_Install : Tool_API
+ {
+ public Python_Install()
+ {
+ config("WireShark",
+ "http://wiresharkdownloads.riverbed.com/wireshark/win32/Wireshark-win32-1.10.0.exe".uri(),
+ ProgramFilesFolder.pathCombine(@"WireShark/Wireshark.exe"));
+
+ startInstaller_FromMsi_Web();
+
+ }
+
+ public Process start()
+ {
+ if (this.isInstalled())
+ return this.Executable.startProcess();
+ return null;
+ }
+ }
+}

0 comments on commit 68c1c07

Please sign in to comment.