From fa456f432c39ac3cbabaa582971ebcbcbb68e4f5 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Wed, 19 Sep 2007 17:35:25 +0000
Subject: [PATCH] - add Mac native application bundles for QuickSetup, Uninstall and StatusPanel. note that these bundles are not self contained and cannot be arbitrary moved outside of OpenDS distribution or installation location.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetup.java | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetup.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetup.java
index 67ea53e..6bd64a8 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetup.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetup.java
@@ -43,6 +43,7 @@
import javax.swing.*;
import java.awt.Cursor;
+import java.util.ArrayList;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.logging.Handler;
@@ -93,6 +94,9 @@
// Update period of the dialogs.
private static final int UPDATE_PERIOD = 500;
+ // The full pathname of the MacOS X LaunchServices OPEN(1) helper.
+ private static final String MAC_APPLICATIONS_OPENER = "/usr/bin/open";
+
/**
* This method creates the install/uninstall dialogs and to check the current
* install status. This method must be called outside the event thread because
@@ -388,8 +392,16 @@
} else {
installation = Installation.getLocal();
}
- String cmd = getPath(installation.getStatusPanelCommandFile());
- ProcessBuilder pb = new ProcessBuilder(cmd);
+ ProcessBuilder pb;
+ if (isMacOS()) {
+ ArrayList<String> cmd = new ArrayList<String>();
+ cmd.add(MAC_APPLICATIONS_OPENER);
+ cmd.add(getPath(installation.getStatusPanelCommandFile()));
+ pb = new ProcessBuilder(cmd);
+ } else {
+ String cmd = getPath(installation.getStatusPanelCommandFile());
+ pb = new ProcessBuilder(cmd);
+ }
Map<String, String> env = pb.environment();
env.put("JAVA_HOME", System.getProperty("java.home"));
/* Remove JAVA_BIN to be sure that we use the JVM running the
--
Gitblit v1.10.0