Revision: 5585
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5585&view=rev
Author: manningr
Date: 2010-04-24 15:08:44 +0000 (Sat, 24 Apr 2010)
Log Message:
-----------
2991709 (Quotes missing in squirrel-sql.bat): rather than do as suggested in the bug report, we remove the reference to the CLASSPATH entirely. If we were to keep it, then to properly quote it, we would need to split it into a path list (on ';'), iterate over each path element in the list and test them for spaces and then for quotes if spaces are found. This seems like too much work to do in Windows batch language, so just remove the reference to CLASSPATH for now. Also, cleaned up "alternate" invocations at the bottom of the script which in some cases were not up to date, and in others confusing to users.
2981691 (Installer does not make sure a JRE is available (Windows 7)): We now prefer the JRE that was used to launcher the IzPack installer, and if that is not available, we choose whatever javaw happens to be in the PATH. Using JAVA_HOME is now difficult since the installer wants to replace %JAVA_HOME with it's JRE path; and so referencing %JAVA_HOME% in the script is bad because it get's partially replaced during the installation filtering. That isn't a terrible loss given that in some cases people have complained about this being set (for whatever reason) to an older or incompatible version of Java.
Modified Paths:
--------------
trunk/sql12/app/cmd/squirrel-sql.bat
Modified: trunk/sql12/app/cmd/squirrel-sql.bat
===================================================================
--- trunk/sql12/app/cmd/squirrel-sql.bat 2010-04-24 01:37:52 UTC (rev 5584)
+++ trunk/sql12/app/cmd/squirrel-sql.bat 2010-04-24 15:08:44 UTC (rev 5585)
@@ -1,8 +1,22 @@
@echo off
-IF "%JAVA_HOME%"=="" SET LOCAL_JAVA=java
-IF NOT "%JAVA_HOME%"=="" SET LOCAL_JAVA=%JAVA_HOME%\bin\java
+@rem IZPACK_JAVA is filtered in by the IzPack installer (via %JAVA_HOME) when this script is installed
+set IZPACK_JAVA=%JAVA_HOME
+@rem We detect the java executable to use according to the following algorithm:
+@rem
+@rem 1. If the one used by the IzPack installer is available then use that; otherwise
+@rem 2. Use the java that is in the command path.
+@rem
+
+if exist "%IZPACK_JAVA%\bin\javaw.exe" (
+ set LOCAL_JAVA=%IZPACK_JAVA%\bin\javaw.exe
+) else (
+ set LOCAL_JAVA=javaw.exe
+)
+
+echo Using java: %LOCAL_JAVA%
+
set basedir=%~f0
:strip
set removed=%basedir:~-1%
@@ -15,7 +29,7 @@
@rem that version of higher. The arguments to JavaVersionChecker below specify the minimum acceptable version
@rem (first arg) and any other acceptable subsequent versions. <MAJOR>.<MINOR> should be all that is
@rem necessary for the version form.
-"%LOCAL_JAVA%w" -cp "%SQUIRREL_SQL_HOME%\lib\versioncheck.jar" JavaVersionChecker 1.6 1.7
+"%LOCAL_JAVA%" -cp "%SQUIRREL_SQL_HOME%\lib\versioncheck.jar" JavaVersionChecker 1.6 1.7
if ErrorLevel 1 goto ExitForWrongJavaVersion
@rem If the changelist.xml file isn't present or the downloaded update jars don't exist, skip launching the updater - these files are created by the
@@ -27,36 +41,23 @@
FOR /F %%I IN (%TEMP%\update-lib.tmp) DO CALL "%SQUIRREL_SQL_HOME%\addpath.bat" "%SQUIRREL_SQL_HOME%\update\downloads\core\%%I"
SET UPDATE_CP=%TMP_CP%
SET UPDATE_PARMS=--log-config-file "%SQUIRREL_SQL_HOME%\update-log4j.properties" --squirrel-home "%SQUIRREL_SQL_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9
-"%LOCAL_JAVA%w" -cp %UPDATE_CP% -Dlog4j.defaultInitOverride=true -Dprompt=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication %UPDATE_PARAMS%
+"%LOCAL_JAVA%" -cp %UPDATE_CP% -Dlog4j.defaultInitOverride=true -Dprompt=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication %UPDATE_PARAMS%
:launchsquirrel
@rem build SQuirreL's classpath
set TMP_CP="%SQUIRREL_SQL_HOME%\squirrel-sql.jar"
dir /b "%SQUIRREL_SQL_HOME%\lib\*.*" > %TEMP%\squirrel-lib.tmp
FOR /F %%I IN (%TEMP%\squirrel-lib.tmp) DO CALL "%SQUIRREL_SQL_HOME%\addpath.bat" "%SQUIRREL_SQL_HOME%\lib\%%I"
-SET SQUIRREL_CP=%TMP_CP%;%CLASSPATH%
+SET SQUIRREL_CP=%TMP_CP%
echo "SQUIRREL_CP=%SQUIRREL_CP%"
SET TMP_PARMS=--log-config-file "%SQUIRREL_SQL_HOME%\log4j.properties" --squirrel-home "%SQUIRREL_SQL_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9
-@rem Run with a command window.
-@rem "%LOCAL_JAVA%" -cp %TMP_CP% net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
-
-@rem To add translation working directories to your classpath edit and uncomment this line:
-@rem start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Xmx256m -cp %TMP_CP%;<your working dir here> net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
-
@rem -Dsun.java2d.noddraw=true prevents performance problems on Win32 systems.
-@rem To change the language edit and uncomment this line:
-@rem start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Xmx256m -Dsun.java2d.noddraw=true -cp %TMP_CP%;<your working dir here> -Duser.language=<your language here> net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
+@rem Run with no command window. This may not work with versions of Windows prior to XP.
+@rem Remove 'start "SQuirreL SQL Client" /B' for compatibility only if necessary
+start "SQuirreL SQL Client" /B "%LOCAL_JAVA%" -Xmx256m -Dsun.java2d.noddraw=true -cp %SQUIRREL_CP% net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
-@rem Run with no command window. This may not work with older versions of Windows. Use the command above then.
-start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Xmx256m -Dsun.java2d.noddraw=true -cp %SQUIRREL_CP% net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
+:ExitForWrongJavaVersion
-@rem Run the executable jar file with or without a cmd window. However the
-@rem classes from the %CLASSPATH% environment variable will not be available.
-@rem "%LOCAL_JAVA%" -jar "%SQUIRREL_SQL_HOME%\squirrel-sql.jar" %TMP_PARMS%
-@rem start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Dsun.java2d.noddraw=true -jar "%SQUIRREL_SQL_HOME%\squirrel-sql.jar" %TMP_PARMS%
-
-:ExitForWrongJavaVersion
-exit
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|