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
 	if [ $? -eq 0 ]; then
390
 	if [ $? -eq 0 ]; then
391
 		echo "Setup completed."
391
 		echo "Setup completed."
392
 	else
392
 	else
393
-		echo "Setup failed."
393
+		echo "Setup did not complete."
394
 	fi
394
 	fi
395
 else
395
 else
396
 	echo "No setup.sh found. This was pointless?"
396
 	echo "No setup.sh found. This was pointless?"

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

167
 	echo "---------------------"
167
 	echo "---------------------"
168
 	echo "-h, --help                Help information"
168
 	echo "-h, --help                Help information"
169
 	echo "-r, --release [version]   This is a release"
169
 	echo "-r, --release [version]   This is a release"
170
-#	echo "-s, --script              Don't use installer.jar (not implemented yet)"
171
 	echo "---------------------"
170
 	echo "---------------------"
172
 	exit 0;
171
 	exit 0;
173
 }
172
 }
174
 
173
 
175
 # Check for some CLI params
174
 # Check for some CLI params
176
-scriptOnly="false"
177
 isRelease=""
175
 isRelease=""
178
 while test -n "$1"; do
176
 while test -n "$1"; do
179
 	case "$1" in
177
 	case "$1" in
180
-		--script|-s)
181
-			scriptOnly="true"
182
-			shift
183
-			;;
184
 		--release|-r)
178
 		--release|-r)
185
 			shift
179
 			shift
186
 			isRelease=${1}
180
 			isRelease=${1}
197
 fi
191
 fi
198
 
192
 
199
 if [ -e "DMDirc.jar" ]; then
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
 		if [ $? -ne 0 ]; then
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
 	fi
207
 	fi
218
 else
208
 else
219
 	echo "No installer found!"
209
 	echo "No installer found!"

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

406
 	params: String = '';
406
 	params: String = '';
407
 	dir: String = '';
407
 	dir: String = '';
408
 	Reg: TRegistry;
408
 	Reg: TRegistry;
409
+	result: Integer;
409
 begin
410
 begin
410
 	{$IFDEF LAZARUS}
411
 	{$IFDEF LAZARUS}
411
 		Application.Initialize;
412
 		Application.Initialize;
469
 			end
470
 			end
470
 			else begin
471
 			else begin
471
 				// Try again now that java is installed.
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
 			end;
474
 			end;
474
 		end
475
 		end
475
 		else begin
476
 		else begin
476
 			// Java is the right version, run the installer
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
 		end;
479
 		end;
479
-end
480
+		if result = 0 then dowriteln('Installation completed.')
481
+		else dowriteln('Installation did not complete.')
482
+	end
480
 	else begin
483
 	else begin
481
 		dowriteln('Failed!');
484
 		dowriteln('Failed!');
482
 		errorMessage := errorMessage+'DMDirc.jar was not found.';
485
 		errorMessage := errorMessage+'DMDirc.jar was not found.';

Loading…
Cancel
Save