Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/15 14:00:38 (10 years ago)
Author:
bburlacu
Message:

#2276: Merged trunk changes.

Location:
branches/HeuristicLab.DatasetRefactor/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DatasetRefactor/sources

  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/Program.cs

    r12031 r12109  
    2929    private static void Main(string[] args) {
    3030      // 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           }
     31      bool installDone = false;
     32      try {
     33        string parameter = string.Concat(args);
     34        switch (parameter) {
     35          case "--install":
     36            installDone = true;
     37            ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
     38            break;
     39          case "--uninstall":
     40            installDone = true;
     41            ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
     42            break;
    4243        }
    43         catch (Exception ex) {
    44           Console.WriteLine("Error on (un)install of Hive Slave service: " + Environment.NewLine + ex);
    45         }
    46       } else {
     44      }
     45      catch (Exception ex) {
     46        Console.WriteLine("Error on (un)install of Hive Slave service: " + Environment.NewLine + ex);
     47      }
     48
     49      if (!installDone) {
    4750        ServiceBase[] ServicesToRun;
    4851        ServicesToRun = new ServiceBase[]
Note: See TracChangeset for help on using the changeset viewer.