Changeset 11749 for stable/HeuristicLab.Services.Hive.JanitorService
- Timestamp:
- 01/13/15 13:33:12 (10 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11364-11366,11599,11652
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.JanitorService/3.3/HeuristicLab.Services.Hive.JanitorService-3.3.csproj
r8600 r11749 135 135 </EmbeddedResource> 136 136 </ItemGroup> 137 <ItemGroup> 138 <Content Include="ICSharpCode.SharpZipLib License.txt"> 139 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 140 </Content> 141 </ItemGroup> 137 142 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 138 143 <PropertyGroup> 139 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)144 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 140 145 set ProjectDir=$(ProjectDir) 141 146 set SolutionDir=$(SolutionDir) … … 143 148 144 149 call PreBuildEvent.cmd</PreBuildEvent> 145 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">150 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 146 151 export ProjectDir=$(ProjectDir) 147 152 export SolutionDir=$(SolutionDir) -
stable/HeuristicLab.Services.Hive.JanitorService/3.3/Program.cs
r11170 r11749 20 20 #endregion 21 21 22 using System; 23 using System.Configuration.Install; 24 using System.Reflection; 22 25 using System.ServiceProcess; 23 26 24 27 namespace HeuristicLab.Services.Hive.JanitorService { 25 28 static class Program { 26 /// <summary> 27 /// The main entry point for the application. 28 /// </summary> 29 static void Main() { 30 ServiceBase[] ServicesToRun; 31 ServicesToRun = new ServiceBase[] 32 { 33 new JanitorService() 34 }; 35 ServiceBase.Run(ServicesToRun); 29 private static void Main(string[] args) { 30 // Install as service, see http://stackoverflow.com/a/12703878 31 if (Environment.UserInteractive) { 32 try { 33 string parameter = string.Concat(args); 34 switch (parameter) { 35 case "--install": 36 ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location }); 37 break; 38 case "--uninstall": 39 ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location }); 40 break; 41 } 42 } 43 catch (Exception ex) { 44 Console.WriteLine("Error on (un)install of Hive Slave service: " + Environment.NewLine + ex); 45 } 46 } else { 47 ServiceBase[] ServicesToRun; 48 ServicesToRun = new ServiceBase[] 49 { 50 new JanitorService() 51 }; 52 ServiceBase.Run(ServicesToRun); 53 } 36 54 } 37 55 }
Note: See TracChangeset
for help on using the changeset viewer.