Browse Source

Fixes issue 1479 again.


git-svn-id: http://svn.dmdirc.com/trunk@4541 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
60d8fbd414
3 changed files with 19 additions and 26 deletions
  1. 1
    1
      installer/linux/installerstub.sh
  2. 12
    22
      installer/linux/setup.sh
  3. 6
    3
      installer/windows/Setup.dpr

+ 1
- 1
installer/linux/installerstub.sh View File

@@ -390,7 +390,7 @@ if [ -e "${TEMPDIR}/setup.sh" ]; then
390 390
 	if [ $? -eq 0 ]; then
391 391
 		echo "Setup completed."
392 392
 	else
393
-		echo "Setup failed."
393
+		echo "Setup did not complete."
394 394
 	fi
395 395
 else
396 396
 	echo "No setup.sh found. This was pointless?"

+ 12
- 22
installer/linux/setup.sh View File

@@ -167,20 +167,14 @@ showHelp() {
167 167
 	echo "---------------------"
168 168
 	echo "-h, --help                Help information"
169 169
 	echo "-r, --release [version]   This is a release"
170
-#	echo "-s, --script              Don't use installer.jar (not implemented yet)"
171 170
 	echo "---------------------"
172 171
 	exit 0;
173 172
 }
174 173
 
175 174
 # Check for some CLI params
176
-scriptOnly="false"
177 175
 isRelease=""
178 176
 while test -n "$1"; do
179 177
 	case "$1" in
180
-		--script|-s)
181
-			scriptOnly="true"
182
-			shift
183
-			;;
184 178
 		--release|-r)
185 179
 			shift
186 180
 			isRelease=${1}
@@ -197,23 +191,19 @@ if [ "${isRelease}" != "" ]; then
197 191
 fi
198 192
 
199 193
 if [ -e "DMDirc.jar" ]; then
200
-	if [ "${scriptOnly}" = "true" ]; then
201
-		echo "Script-only install requested."
202
-	else
203
-		echo "Checking java version.."
204
-		${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main --help >/dev/null
194
+	echo "Checking java version.."
195
+	${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main --help >/dev/null
196
+	if [ $? -ne 0 ]; then
197
+		installjre "upgrade"
198
+		echo "Trying to run installer.."
199
+		${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main ${isRoot}${isRelease}
205 200
 		if [ $? -ne 0 ]; then
206
-			installjre "upgrade"
207
-			echo "Trying to run installer.."
208
-			${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main ${isRoot}${isRelease}
209
-			if [ $? -ne 0 ]; then
210
-				exit 1;
211
-			fi;
212
-		else
213
-			echo "Running installer.."
214
-			${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main ${isRoot}${isRelease}
215
-		fi
216
-		exit 0;
201
+			exit 1;
202
+		fi;
203
+	else
204
+		echo "Running installer.."
205
+		${JAVA} -cp DMDirc.jar com.dmdirc.installer.Main ${isRoot}${isRelease}
206
+		exit $?
217 207
 	fi
218 208
 else
219 209
 	echo "No installer found!"

+ 6
- 3
installer/windows/Setup.dpr View File

@@ -406,6 +406,7 @@ var
406 406
 	params: String = '';
407 407
 	dir: String = '';
408 408
 	Reg: TRegistry;
409
+	result: Integer;
409 410
 begin
410 411
 	{$IFDEF LAZARUS}
411 412
 		Application.Initialize;
@@ -469,14 +470,16 @@ begin
469 470
 			end
470 471
 			else begin
471 472
 				// Try again now that java is installed.
472
-				ExecAndWait(javaCommand+' -cp DMDirc.jar com.dmdirc.installer.Main '+params);
473
+				result := ExecAndWait(javaCommand+' -cp DMDirc.jar com.dmdirc.installer.Main '+params);
473 474
 			end;
474 475
 		end
475 476
 		else begin
476 477
 			// Java is the right version, run the installer
477
-			ExecAndWait(javaCommand+' -cp DMDirc.jar com.dmdirc.installer.Main '+params);
478
+			result := ExecAndWait(javaCommand+' -cp DMDirc.jar com.dmdirc.installer.Main '+params);
478 479
 		end;
479
-end
480
+		if result = 0 then dowriteln('Installation completed.')
481
+		else dowriteln('Installation did not complete.')
482
+	end
480 483
 	else begin
481 484
 		dowriteln('Failed!');
482 485
 		errorMessage := errorMessage+'DMDirc.jar was not found.';

Loading…
Cancel
Save