Просмотр исходного кода

Linux installer now runs on PCBSD (And probably other BSDs) if java/java6 is pre-installed.

Linux installer now gives a nicer error to mac users who try to run it.


git-svn-id: http://svn.dmdirc.com/trunk@3620 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 лет назад
Родитель
Сommit
f9f94333bf
3 измененных файлов: 41 добавлений и 13 удалений
  1. 29
    5
      installer/linux/setup.sh
  2. 1
    1
      src/com/dmdirc/installer/Main.java
  3. 11
    7
      src/com/dmdirc/installer/StepError.java

+ 29
- 5
installer/linux/setup.sh Просмотреть файл

@@ -23,10 +23,18 @@
23 23
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 24
 # SOFTWARE.
25 25
 
26
-ISKDE=`pidof -x -s kdeinit`
27
-KDIALOG=`which kdialog`
28
-ISGNOME=`pidof -x -s gnome-panel`
29
-ZENITY=`which zenity`
26
+PIDOF=`which pidof`
27
+if [ "" != "${PIDOF}" ]; then
28
+	ISKDE=`${PIDOF} -x -s kdeinit`
29
+	KDIALOG=`which kdialog`
30
+	ISGNOME=`${PIDOF} -x -s gnome-panel`
31
+	ZENITY=`which zenity`
32
+else
33
+	ISKDE=""
34
+	KDIALOG=""
35
+	ISGNOME=""
36
+	ZENITY=""
37
+fi;
30 38
 
31 39
 errordialog() {
32 40
 	# Send message to console.
@@ -47,12 +55,20 @@ errordialog() {
47 55
 	fi
48 56
 }
49 57
 
58
+UNAME=`uname -a`
59
+isLinux=`echo ${UNAME} | grep -i linux`
60
+
50 61
 echo ""
51 62
 echo "---------------------"
52 63
 echo "Setup.sh"
53 64
 echo "---------------------"
54 65
 echo -n "Looking for java.. ";
55
-JAVA=`which java`
66
+# Location where ports on FreeBSD/PCBSD installs java6
67
+# check it first, because it isn't added to the path automatically
68
+JAVA="/usr/local/jdk1.6.0/jre/bin/java"
69
+if [ ! -e "${JAVA}" ]; then
70
+	JAVA=`which java`
71
+fi
56 72
 
57 73
 installjre() {
58 74
 	result=1
@@ -97,6 +113,10 @@ if [ "" != "${JAVA}" ]; then
97 113
 	echo "Success!"
98 114
 else
99 115
 	echo "Failed!"
116
+	if [ "" == "${isLinux}" ]; then
117
+		errordialog "DMDirc Setup" "Sorry, DMDirc setup can not continue without java 6."
118
+		exit 1
119
+	fi;
100 120
 	installjre "install"
101 121
 fi
102 122
 
@@ -155,6 +175,10 @@ if [ -e "installer.jar" ]; then
155 175
 		echo "Running installer.."
156 176
 		${JAVA} -cp DMDirc.jar -jar installer.jar ${isRoot}${isRelease}
157 177
 		if [ $? -ne 0 ]; then
178
+			if [ "" == "${isLinux}" ]; then
179
+				errordialog "DMDirc Setup" "Sorry, DMDirc setup can not continue without java 6."
180
+				exit 1
181
+			fi;
158 182
 			installjre "upgrade"
159 183
 			echo "Trying to run installer again.."
160 184
 			${JAVA} -cp DMDirc.jar -jar installer.jar ${isRoot}${isRelease}

+ 1
- 1
src/com/dmdirc/installer/Main.java Просмотреть файл

@@ -99,7 +99,7 @@ public final class Main implements WizardListener {
99 99
 		final String osName = System.getProperty("os.name");
100 100
 		wizardDialog.addStep(new StepWelcome(releaseName));
101 101
 		if (osName.startsWith("Mac OS")) {
102
-			wizardDialog.addStep(new StepError());
102
+			wizardDialog.addStep(new StepError("Sorry, OSX Installation should be done using the downloadable dmg file, not this installer.\n\n"));
103 103
 		} else {
104 104
 			wizardDialog.addStep(new StepSettings());
105 105
 			wizardDialog.addStep(new StepConfirm(wizardDialog));

+ 11
- 7
src/com/dmdirc/installer/StepError.java Просмотреть файл

@@ -43,21 +43,25 @@ public final class StepError extends Step {
43 43
 	private static final long serialVersionUID = 2;
44 44
 	
45 45
 	/**
46
-	 * Creates a new instance of StepOne.
46
+	 * Creates a new instance of StepError with a default error message.
47 47
 	 */
48 48
 	public StepError() {
49
+		this("Sorry, it is not possible to install DMDirc on this system at this time.\n\n");
50
+	}
51
+	
52
+	/**
53
+	 * Creates a new instance of StepError with a given error message.
54
+	 *
55
+	 * @param message Error message to show.
56
+	 */
57
+	public StepError(final String message) {
49 58
 		super();
50 59
 		setLayout(new BorderLayout());
51 60
 		setBorder(BorderFactory.createEmptyBorder(LARGE_BORDER, LARGE_BORDER, SMALL_BORDER, LARGE_BORDER));
52 61
 		
53 62
 		JWrappingLabel infoLabel;
54
-		infoLabel = new JWrappingLabel("Sorry, it is not possible to install DMDirc on this system at this time.\n\n");
55
-//		infoLabel.setEditable(false);
56
-//		infoLabel.setWrapStyleWord(true);
57
-//		infoLabel.setLineWrap(true);
58
-//		infoLabel.setHighlighter(null);
63
+		infoLabel = new JWrappingLabel(message);
59 64
 		infoLabel.setOpaque(false);
60
-//		infoLabel.setBackground(getBackground());
61 65
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
62 66
 			
63 67
 		add(infoLabel, BorderLayout.CENTER);

Загрузка…
Отмена
Сохранить