From f40316d425413e23a8ad77aa268e3d1bed977e0e Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 13 Oct 2009 22:52:40 +0000
Subject: [PATCH] Apply the same fix done for issue 4273 (server does not work as service if Windows UAC enabled in Windows Server 2008) to Windows 7.

---
 opends/src/server/org/opends/server/util/SetupUtils.java |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/SetupUtils.java b/opends/src/server/org/opends/server/util/SetupUtils.java
index 764f4b8..1877e8a 100644
--- a/opends/src/server/org/opends/server/util/SetupUtils.java
+++ b/opends/src/server/org/opends/server/util/SetupUtils.java
@@ -316,6 +316,27 @@
   }
 
   /**
+   * Indicates whether the underlying operating system is Windows 7.
+   *
+   * @return  {@code true} if the underlying operating system is Windows 7, or
+   * {@code false} if not.
+   */
+  public static boolean isWindows7()
+  {
+    boolean isWindows7;
+    String os = System.getProperty("os.name");
+    if (os != null)
+    {
+      isWindows7 = (os.toLowerCase().indexOf("windows 7") != -1);
+    }
+    else
+    {
+      isWindows7 = false;
+    }
+    return isWindows7;
+  }
+
+  /**
    * Indicates whether the underlying operating system has UAC (User Access
    * Control).
    *
@@ -324,7 +345,7 @@
    */
   public static boolean hasUAC()
   {
-    return SetupUtils.isVista() || SetupUtils.isWindows2008();
+    return isVista() || isWindows2008() || isWindows7();
   }
 
   /**

--
Gitblit v1.10.0