Update of /cvsroot/squirrel-sql/mavenize/squirrelsql-launcher/src/main/resources
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15155/squirrelsql-launcher/src/main/resources
Added Files:
log4j.properties addpath.bat restore.bat
update-log4j.properties squirrel-sql.sh restore.sh
squirrel-sql.bat
Log Message:
Maven project to contain the application launcher scripts.
--- NEW FILE: addpath.bat ---
set TMP_CP=%TMP_CP%;%1
--- NEW FILE: log4j.properties ---
log4j.rootLogger=info, SquirrelAppender
log4j.appender.SquirrelAppender=net.sourceforge.squirrel_sql.client.SquirrelFileSizeRollingAppender
log4j.appender.SquirrelAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.SquirrelAppender.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
--- NEW FILE: restore.bat ---
@echo off
IF "%JAVA_HOME%"=="" SET LOCAL_JAVA=java
IF NOT "%JAVA_HOME%"=="" SET LOCAL_JAVA=%JAVA_HOME%\bin\java
set basedir=%~f0
:strip
set removed=%basedir:~-1%
set basedir=%basedir:~0,-1%
if NOT "%removed%"=="\" goto strip
set SQUIRREL_SQL_HOME=%basedir%
@rem build Updater's classpath and parameters
SET TMP_CP="%SQUIRREL_SQL_HOME%\update\downloads\core\squirrel-sql.jar"
dir /b "%SQUIRREL_SQL_HOME%\update\downloads\core\*.*" > %TEMP%\update-lib.tmp
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%
echo "UPDATE_CP=%UPDATE_CP%"
@rem launch updater in "restore" mode
SET UPDATE_PARMS=--log-config-file "%SQUIRREL_SQL_HOME%\update-log4j.properties" --squirrel-home "%SQUIRREL_SQL_HOME%"
"%LOCAL_JAVA%w" -cp %UPDATE_CP% -Dlog4j.defaultInitOverride=true -Drestore=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication %UPDATE_PARAMS%
--- NEW FILE: restore.sh ---
#! /bin/sh
[ ${JAVA_HOME} ] && JAVA=${JAVA_HOME}/bin/java || [ %JAVA_HOME ] && JAVA=%JAVA_HOME/bin/java || JAVA=java
# Are we running within Cygwin on some version of Windows?
cygwin=false;
case "`uname -s`" in
CYGWIN*) cygwin=true ;;
esac
# Squirrel home.
SQUIRREL_SQL_HOME='%INSTALL_PATH'
# SQuirreL home in Unix format.
if $cygwin ; then
UNIX_STYLE_HOME=`cygpath "$SQUIRREL_SQL_HOME"`
else
UNIX_STYLE_HOME=$SQUIRREL_SQL_HOME
fi
set basedir=%~f0
:strip
set removed=%basedir:~-1%
set basedir=%basedir:~0,-1%
if NOT "%removed%"=="\" goto strip
set SQUIRREL_SQL_HOME=%basedir%
@rem build Updater's classpath and parameters
SET TMP_CP="%SQUIRREL_SQL_HOME%\update\downloads\core\squirrel-sql.jar"
dir /b "%SQUIRREL_SQL_HOME%\update\downloads\core\*.*" > %TEMP%\update-lib.tmp
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%
echo "UPDATE_CP=%UPDATE_CP%"
@rem launch updater in "restore" mode
SET UPDATE_PARMS=--log-config-file "%SQUIRREL_SQL_HOME%\update-log4j.properties" --squirrel-home "%SQUIRREL_SQL_HOME%"
"%LOCAL_JAVA%w" -cp %UPDATE_CP% -Dlog4j.defaultInitOverride=true -Drestore=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication %UPDATE_PARAMS%
--- NEW FILE: squirrel-sql.sh ---
#! /bin/sh
[ ${JAVA_HOME} ] && JAVA=${JAVA_HOME}/bin/java || [ %JAVA_HOME ] && JAVA=%JAVA_HOME/bin/java || JAVA=java
# Are we running within Cygwin on some version of Windows?
cygwin=false;
macosx=false;
case "`uname -s`" in
CYGWIN*) cygwin=true ;;
esac
case "`uname -s`" in
Darwin) macosx=true;;
esac
# SQuirreL home.
if $macosx ; then
SQUIRREL_SQL_HOME='%INSTALL_PATH/Contents/Resources/Java'
else
SQUIRREL_SQL_HOME='%INSTALL_PATH'
fi
# SQuirreL home in Unix format.
if $cygwin ; then
UNIX_STYLE_HOME=`cygpath "$SQUIRREL_SQL_HOME"`
else
UNIX_STYLE_HOME="$SQUIRREL_SQL_HOME"
fi
cd "$UNIX_STYLE_HOME"
# Check to see if the JVM meets the minimum required to run SQuirreL and inform the user if not and skip
# launch. versioncheck.jar is a special jar file which has been compiled with javac version 1.2.2, which
# should be able to be run by that version of higher. The arguments to JavaVersionChecker below specify the
# minimum acceptable version (first arg) and any other acceptable subsequent versions. <MAJOR>.<MINOR> should
# be all that is necessary for the version form.
$JAVA -cp "$UNIX_STYLE_HOME/lib/versioncheck.jar" JavaVersionChecker 1.6 1.7
if [ "$?" = "1" ]; then
exit
fi
# First entry in classpath is the Squirrel application.
TMP_CP="$UNIX_STYLE_HOME/squirrel-sql.jar"
# Then add all library jars to the classpath.
for a in "$UNIX_STYLE_HOME"/lib/*; do
TMP_CP="$TMP_CP":"$a";
done
# Set the update app's classpath to use jars in download area first, then the installed jars
UPDATE_CP=$TMP_CP
for a in "$UNIX_STYLE_HOME"/update/downloads/core/*; do
UPDATE_CP="$a":"$UPDATE_CP"
done
# Now add the system classpath to the classpath. If running
# Cygwin we also need to change the classpath to Windows format.
if $cygwin ; then
TMP_CP=`cygpath -w -p $TMP_CP`
UPDATE_CP=`cygpath -w -p $UPDATE_CP`
TMP_CP=$TMP_CP';'$CLASSPATH
UPDATE_CP=$UPDATE_CP';'$CLASSPATH
else
TMP_CP=$TMP_CP:$CLASSPATH
UPDATE_CP=$UPDATE_CP:$CLASSPATH
fi
if $macosx ; then
# Define mac-specific system properties if running on Mac OS X
MACOSX_UPDATER_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQLUpdater"
MACOSX_SQUIRREL_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQL"
NATIVE_LAF_PROP="--native-laf"
fi
# Check for updates and prompt to apply if any are available
if [ -f "$UNIX_STYLE_HOME/update/downloads/core/squirrel-sql.jar" -a -f "$UNIX_STYLE_HOME/update/changeList.xml" ]; then
$JAVA -cp "$UPDATE_CP" $MACOSX_UPDATER_PROPS -Dlog4j.defaultInitOverride=true -Dprompt=true net.sourceforge.squirrel_sql.client.update.gui.installer.PreLaunchUpdateApplication -l "$UNIX_STYLE_HOME/update-log4j.properties"
fi
if $macosx ; then
# macosx provides unknown args to the script, causing SQuirreL to bail..
SCRIPT_ARGS=""
else
SCRIPT_ARGS="$1 $2 $3 $4 $5 $6 $7 $8 $9"
fi
# Launch SQuirreL application
$JAVA -Xmx256m -cp "$TMP_CP" $MACOSX_SQUIRREL_PROPS net.sourceforge.squirrel_sql.client.Main --log-config-file "$UNIX_STYLE_HOME"/log4j.properties --squirrel-home "$UNIX_STYLE_HOME" $NATIVE_LAF_PROP $SCRIPT_ARGS
--- NEW FILE: update-log4j.properties ---
log4j.appender.SquirrelAppender=net.sourceforge.squirrel_sql.client.SquirrelAppender
log4j.appender.SquirrelAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.SquirrelAppender.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
log4j.appender.SquirrelAppender.DatePattern='.'yyyy-ww
log4j.rootLogger=debug, SquirrelAppender
log4j.logger.org.springframework=WARN, SquirrelAppender
--- NEW FILE: squirrel-sql.bat ---
@echo off
IF "%JAVA_HOME%"=="" SET LOCAL_JAVA=java
IF NOT "%JAVA_HOME%"=="" SET LOCAL_JAVA=%JAVA_HOME%\bin\java
set basedir=%~f0
:strip
set removed=%basedir:~-1%
set basedir=%basedir:~0,-1%
if NOT "%removed%"=="\" goto strip
set SQUIRREL_SQL_HOME=%basedir%
@rem Check to see if we are running in a 1.6/1.7 JVM and inform the user if not and skip launch. versioncheck.jar
@rem is a special jar file which has been compiled with javac version 1.2.2, which should be able to be run by
@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
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
@rem software update feature inside of SQuirreL. So their absence, simply means the software update feature hasn't been accessed.
if not exist "%SQUIRREL_SQL_HOME%\update\changeList.xml" goto launchsquirrel
SET TMP_CP="%SQUIRREL_SQL_HOME%\update\downloads\core\squirrel-sql.jar"
if not exist %TMP_CP% goto launchsquirrel
dir /b "%SQUIRREL_SQL_HOME%\update\downloads\core\*.*" > %TEMP%\update-lib.tmp
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%
: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%"
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 To change the language edit and uncomment this line:
@rem start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Xmx256m -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 older versions of Windows. Use the command above then.
start "SQuirreL SQL Client" /B "%LOCAL_JAVA%w" -Xmx256m -cp %SQUIRREL_CP% net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
@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" -jar "%SQUIRREL_SQL_HOME%\squirrel-sql.jar" %TMP_PARMS%
:ExitForWrongJavaVersion
exit
|