Index: trunk/sources/HeuristicLab 3.3 Hive.Slave.sln
===================================================================
--- trunk/sources/HeuristicLab 3.3 Hive.Slave.sln	(revision 11364)
+++ trunk/sources/HeuristicLab 3.3 Hive.Slave.sln	(revision 11365)
@@ -1,5 +1,5 @@
 ﻿
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave-3.3", "HeuristicLab.Clients.Hive.Slave\3.3\HeuristicLab.Clients.Hive.Slave-3.3.csproj", "{989FE92B-484E-41EE-87E2-6A24AF0381D8}"
 EndProject
@@ -12,9 +12,5 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.TrayIcon-3.3", "HeuristicLab.Clients.Hive.Slave.TrayIcon\3.3\HeuristicLab.Clients.Hive.Slave.TrayIcon-3.3.csproj", "{7C4B1DE4-FC9A-4448-BCF8-3CB3FA3CB8FA}"
 EndProject
-Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HeuristicLab.Clients.Hive.Slave.TrayIconSetup-3.3", "HeuristicLab.Clients.Hive.Slave.TrayIconSetup\HeuristicLab.Clients.Hive.Slave.TrayIconSetup.vdproj", "{57E37188-4523-4F8D-8CEF-AE0AA27BB754}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.WindowsService-3.3", "HeuristicLab.Clients.Hive.Slave.WindowsService\3.3\HeuristicLab.Clients.Hive.Slave.WindowsService-3.3.csproj", "{BA8001DE-E83C-4B1F-8B2E-2695C4222491}"
-EndProject
-Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup-3.3", "HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup\HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup.vdproj", "{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}"
 EndProject
 Global
@@ -88,16 +84,4 @@
 		{7C4B1DE4-FC9A-4448-BCF8-3CB3FA3CB8FA}.Release|x86.ActiveCfg = Release|x86
 		{7C4B1DE4-FC9A-4448-BCF8-3CB3FA3CB8FA}.Release|x86.Build.0 = Release|x86
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|Any CPU.ActiveCfg = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|Any CPU.Build.0 = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|x64.ActiveCfg = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|x64.Build.0 = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|x86.ActiveCfg = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Debug|x86.Build.0 = Debug
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|Any CPU.ActiveCfg = Release
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|Any CPU.Build.0 = Release
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|x64.ActiveCfg = Release
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|x64.Build.0 = Release
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|x86.ActiveCfg = Release
-		{57E37188-4523-4F8D-8CEF-AE0AA27BB754}.Release|x86.Build.0 = Release
 		{BA8001DE-E83C-4B1F-8B2E-2695C4222491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BA8001DE-E83C-4B1F-8B2E-2695C4222491}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -112,16 +96,4 @@
 		{BA8001DE-E83C-4B1F-8B2E-2695C4222491}.Release|x86.ActiveCfg = Release|x86
 		{BA8001DE-E83C-4B1F-8B2E-2695C4222491}.Release|x86.Build.0 = Release|x86
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|Any CPU.ActiveCfg = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|Any CPU.Build.0 = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|x64.ActiveCfg = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|x64.Build.0 = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|x86.ActiveCfg = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Debug|x86.Build.0 = Debug
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|Any CPU.ActiveCfg = Release
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|Any CPU.Build.0 = Release
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x64.ActiveCfg = Release
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x64.Build.0 = Release
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x86.ActiveCfg = Release
-		{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x86.Build.0 = Release
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: trunk/sources/HeuristicLab 3.3 Services.sln
===================================================================
--- trunk/sources/HeuristicLab 3.3 Services.sln	(revision 11364)
+++ trunk/sources/HeuristicLab 3.3 Services.sln	(revision 11365)
@@ -1,5 +1,5 @@
 ﻿
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{96396439-A764-4022-A8D2-BE021449B8D1}"
 	ProjectSection(SolutionItems) = preProject
@@ -24,5 +24,5 @@
 	ProjectSection(WebsiteProperties) = preProject
 		TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
-		ProjectReferences = "{CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}|HeuristicLab.Services.Hive-3.3.dll;{EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}|HeuristicLab.Services.Hive.DataAccess-3.3.dll;"
+		ProjectReferences = "{CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}|HeuristicLab.Services.Hive-3.3.dll;{EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}|HeuristicLab.Services.Hive.DataAccess-3.3.dll;{9FAC0B23-2730-452A-9BA0-D7CA1746C541}|HeuristicLab.Services.Access.dll;{BE9B0229-9150-49A4-AEA6-BB58E055992F}|HeuristicLab.GeoIP.dll;{0F652437-998A-4EAB-8BF1-444B5FE8CE97}|HeuristicLab.Services.Access.DataAccess.dll;"
 		Debug.AspNetCompiler.VirtualPath = "/Hive-3.3"
 		Debug.AspNetCompiler.PhysicalPath = "HeuristicLab.Services.Hive.Web\Hive-3.3\"
@@ -45,6 +45,4 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Hive.JanitorService-3.3", "HeuristicLab.Services.Hive.JanitorService\3.3\HeuristicLab.Services.Hive.JanitorService-3.3.csproj", "{F685556B-F6EB-4143-8E7E-662D00FDD299}"
-EndProject
-Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HeuristicLab.Services.Hive.JanitorServiceSetup-3.3", "HeuristicLab.Services.Hive.JanitorServiceSetup\HeuristicLab.Services.Hive.JanitorServiceSetup-3.3.vdproj", "{034C2EE4-E303-4E45-98AB-F0074EC83B81}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.GeoIP", "HeuristicLab.GeoIP\1.12\HeuristicLab.GeoIP.csproj", "{BE9B0229-9150-49A4-AEA6-BB58E055992F}"
@@ -150,16 +148,4 @@
 		{F685556B-F6EB-4143-8E7E-662D00FDD299}.Release|x86.ActiveCfg = Release|x86
 		{F685556B-F6EB-4143-8E7E-662D00FDD299}.Release|x86.Build.0 = Release|x86
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|Any CPU.ActiveCfg = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|Any CPU.Build.0 = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|x64.ActiveCfg = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|x64.Build.0 = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|x86.ActiveCfg = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Debug|x86.Build.0 = Debug
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|Any CPU.ActiveCfg = Release
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|Any CPU.Build.0 = Release
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|x64.ActiveCfg = Release
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|x64.Build.0 = Release
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|x86.ActiveCfg = Release
-		{034C2EE4-E303-4E45-98AB-F0074EC83B81}.Release|x86.Build.0 = Release
 		{BE9B0229-9150-49A4-AEA6-BB58E055992F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BE9B0229-9150-49A4-AEA6-BB58E055992F}.Debug|Any CPU.Build.0 = Debug|Any CPU
Index: trunk/sources/HeuristicLab.Services.Hive.JanitorService/3.3/Program.cs
===================================================================
--- trunk/sources/HeuristicLab.Services.Hive.JanitorService/3.3/Program.cs	(revision 11364)
+++ trunk/sources/HeuristicLab.Services.Hive.JanitorService/3.3/Program.cs	(revision 11365)
@@ -20,18 +20,36 @@
 #endregion
 
+using System;
+using System.Configuration.Install;
+using System.Reflection;
 using System.ServiceProcess;
 
 namespace HeuristicLab.Services.Hive.JanitorService {
   static class Program {
-    /// <summary>
-    /// The main entry point for the application.
-    /// </summary>
-    static void Main() {
-      ServiceBase[] ServicesToRun;
-      ServicesToRun = new ServiceBase[] 
-			{ 
-				new JanitorService() 
-			};
-      ServiceBase.Run(ServicesToRun);
+    private static void Main(string[] args) {
+      // Install as service, see http://stackoverflow.com/a/12703878
+      if (Environment.UserInteractive) {
+        try {
+          string parameter = string.Concat(args);
+          switch (parameter) {
+            case "--install":
+              ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
+              break;
+            case "--uninstall":
+              ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
+              break;
+          }
+        }
+        catch (Exception ex) {
+          Console.WriteLine("Error on (un)install of Hive Slave service: " + Environment.NewLine + ex);
+        }
+      } else {
+        ServiceBase[] ServicesToRun;
+        ServicesToRun = new ServiceBase[]
+        {
+          new JanitorService()
+        };
+        ServiceBase.Run(ServicesToRun);
+      }
     }
   }
