### Eclipse Workspace Patch 1.0
#P Spark
Index: build/installer/izpack/spark
===================================================================
--- build/installer/izpack/spark	(revision 0)
+++ build/installer/izpack/spark	(revision 0)
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Spark Startup
+#
+$SPARK_OPTS=""
+
+# Detect Java
+JAVACMD=$(which java)
+if [ ! -e "$JAVACMD" ]; then
+	# JAVA_HOME set?
+	if [ "" != "$JAVA_HOME" ]; then
+		JAVACMD="$JAVA_HOME/bin/java"
+	fi
+fi
+
+if [ -z "$JAVACMD" ]; then
+	echo "Java VM not found."
+	exit 1	
+fi 
+
+
+# Start Spark
+"$JAVACMD" $SPARK_OPTS -Xmx64M -Dappdir=$INSTALL_PATH \
+   -cp $INSTALL_PATH/lib/linux/jmf.jar:$INSTALL_PATH/lib/startup.jar:$INSTALL_PATH/lib/linux/jdic.jar:$INSTALL_PATH/resources \
+   org.jivesoftware.launcher.Startup $@
Index: build/installer/izpack/default_shortcutSpec.xml
===================================================================
--- build/installer/izpack/default_shortcutSpec.xml	(revision 0)
+++ build/installer/izpack/default_shortcutSpec.xml	(revision 0)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<shortcuts>
+
+	<programGroup defaultName="Spark" location="applications"/>
+	
+	<shortcut
+		name="Spark"
+		programGroup="yes"
+		desktop="yes"
+		applications="no"
+		startMenu="no"
+		startup="no"
+		target="$INSTALL_PATH\Spark.exe"
+		commandLine=""
+		description="Spark"
+		iconFile="$INSTALL_PATH\resources\spark.ico"
+		iconIndex="0"
+		initialState="noShow">
+  
+		<createForPack name="Spark"/>
+
+	</shortcut>
+	
+	<shortcut
+            name="Spark Uninstaller"
+            programGroup="yes"
+            desktop="no"
+            applications="no"
+            startMenu="no"
+            startup="no"
+            target="$INSTALL_PATH\Uninstaller\uninstaller.jar"
+            commandLine=""
+            iconFile="%SystemRoot%\system32\SHELL32.dll"
+            iconIndex="31"
+            description="This uninstalls Spark @build.number@">
+		<createForPack name="Spark"/>
+	</shortcut>
+	
+</shortcuts>
Index: build/installer/izpack/RegistrySpec.xml
===================================================================
--- build/installer/izpack/RegistrySpec.xml	(revision 0)
+++ build/installer/izpack/RegistrySpec.xml	(revision 0)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<registry>
+    <pack name="Spark">
+        <value name="DisplayName"
+               keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spark"
+               root="HKLM"
+               string="Spark"/>
+        <value name="UninstallString"
+               keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spark"
+               root="HKLM"
+               string="&quot;$JAVA_HOME\bin\javaw.exe&quot; -jar &quot;$INSTALL_PATH\uninstaller\uninstaller.jar&quot;"/>
+        <value name="DisplayIcon"
+               keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spark"
+               root="HKLM"
+               string="$INSTALL_PATH\bin\icons\izpack.ico"/>
+        <value name="HelpLink"
+               keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spark"
+               root="HKLM"
+               string="Spark"/>
+        <value name="TaskbarGroupIcon"
+	       keypath="Applications\Spark.exe"
+	       root="HKCR"
+	       string="$INSTALL_PATH\resources\spark.ico" />               
+    </pack>
+</registry>
+
Index: build/installer/izpack/launch4j.tmpl
===================================================================
--- build/installer/izpack/launch4j.tmpl	(revision 0)
+++ build/installer/izpack/launch4j.tmpl	(revision 0)
@@ -0,0 +1,48 @@
+<launch4jConfig>
+  <dontWrapJar>false</dontWrapJar>
+  <headerType>gui</headerType>
+  <jar>@SPARKDIR@/lib/startup.jar</jar>
+  <outfile>@SPARKDIR@/Spark.exe</outfile>
+  <errTitle>Spark</errTitle>
+  <cmdLine></cmdLine>
+  <chdir>.</chdir>
+  <priority>normal</priority>
+  <downloadUrl>http://java.com/download</downloadUrl>
+  <supportUrl></supportUrl>
+  <customProcName>true</customProcName>
+  <stayAlive>true</stayAlive>
+  <manifest></manifest>
+  <classPath>
+    <mainClass>org.jivesoftware.launcher.Startup</mainClass>
+    <cp>./resources</cp>
+    <cp>./lib/*.jar</cp>
+    <cp>./lib/windows/*.jar</cp>
+  </classPath>
+  <icon>@SPARKDIR@/../../src/resources/images/spark.ico</icon>
+  <jre>
+    <path>./jre/</path>
+    <minVersion>1.6.0</minVersion>
+    <maxVersion></maxVersion>
+    <jdkPreference>preferJre</jdkPreference>
+    <opt>-Dappdir=&quot;.&quot;</opt>
+  </jre>
+  <versionInfo>
+    <fileVersion>2.6.0.0</fileVersion>
+    <txtFileVersion>2.6.0</txtFileVersion>
+    <fileDescription>Spark Client</fileDescription>
+    <copyright>http://igniterealtime.org</copyright>
+    <productVersion>2.6.0.0</productVersion>
+    <txtProductVersion>2.6.0</txtProductVersion>
+    <productName>Spark</productName>
+    <companyName>Igniterealtime</companyName>
+    <internalName>Spark Client</internalName>
+    <originalFilename>Spark.exe</originalFilename>
+  </versionInfo>
+  <messages>
+    <startupErr>An error occurred while starting the application.</startupErr>
+    <bundledJreErr>This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.</bundledJreErr>
+    <jreVersionErr>This application requires a Java Runtime Environment.\nAt least version</jreVersionErr>
+    <launcherErr>The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.</launcherErr>
+    <instanceAlreadyExistsMsg>An application instance is already running.</instanceAlreadyExistsMsg>
+  </messages>
+</launch4jConfig>
Index: build/build.xml
===================================================================
--- build/build.xml	(revision 10966)
+++ build/build.xml	(working copy)
@@ -47,6 +47,7 @@
     <description>Spark Build</description>
     <!--set global properties for this build-->
     <property name="src" location="${basedir}/src/java"/>
+	<property name="patch.dir" location="${basedir}/patches/"/>
     <property name="lib.dir" location="${basedir}/build/lib"/>
     <property name="dist.libs.dir" location="${basedir}/build/lib/dist"/>
     <property name="merge.libs.dir" location="${basedir}/build/lib/merge"/>
@@ -68,7 +69,8 @@
     <property name="commercial.plugin.dir" location="${basedir}/src/commercial"/>
     <property name="xtra.dir" location="${basedir}/src/xtra"/>
     <property name="target.xtra" location="${target.build}/xtra"/>
-
+	<property name="release.dir" value="${basedir}/installer"/>
+	
     <!-- Installer Ant Script -->
 
     <property name="installer.install4j.home" value="c:\\Program Files\\install4j"/>
@@ -92,6 +94,10 @@
     <property name="pack200.excludes"
               value="jingle.jar,mail.jar,activation.jar,dom4j.jar,startup.jar,base.jar,i4jruntime.jar"/>
 
+	<!-- IzPack Installer -->
+	<property name="installer.izpack.dir" value="/opt/IzPack/"/>
+	<property name="launch4j.dir" location="/opt/Launch4j" />
+	
     <!-- Define Default Library Archives -->
     <path id="agent.dependencies">
         <fileset dir="${dist.libs.dir}" includes="*.jar"/>
@@ -106,6 +112,8 @@
         <delete failonerror="false">
             <fileset dir="${target}" followsymlinks="false"/>
         </delete>
+    	<delete dir="${release.dir}"  failonerror="false" followsymlinks="false" />
+    	<delete dir="${basedir}/work" failonerror="false" followsymlinks="false" />
     </target>
 
     <!-- init =================================================================================== -->
@@ -160,6 +168,18 @@
         <mkdir dir="${target.xtra}"/>
 
     </target>
+	
+	<!-- patch =================================================================================== -->
+	<target name="patch">
+		<for param="patch">
+			<path>
+				<fileset dir="${patch.dir}" includes="*.patch" />
+			</path>
+			<sequential>
+				<patch patchfile="@{patch}" dir="${basedir}/src" strip="1"/>	
+			</sequential>			
+		</for>		  
+	</target>
 
     <!-- resources =================================================================================== -->
     <target name="resources">
@@ -200,10 +220,11 @@
     <target name="build" depends="init, resources, base">
         <!--Compiles the java code from ${src} directory into ${classes} directory-->
         <javac destdir="${classes}"
-               debug="on"
+               debug="true"
                source="1.6"
                target="1.6"
-                >
+            >
+        	<compilerarg value="-Xlint:deprecation" />
             <classpath>
                 <path refid="agent.dependencies"/>
             </classpath>
@@ -606,9 +627,7 @@
         <!-- <symlink action="delete" failonerror="true" link="${mac.build.dir}/Applications"/> -->
     </target>
 
-    <!--
-     Debian package ========================================================================= 
-    -->
+    <!-- Debian package =========================================================================  -->
     <property name="work.dir" value="${basedir}/work"/>
     <property name="debian.dir" value="${basedir}/build/debian"/>
     <property name="debian.version" value="${version.major}.${version.minor}.${version.revision}"/>
@@ -618,33 +637,33 @@
       <format property="debian.builddate" pattern="EEE, dd MMM yyyy HH:mm:ss Z" locale="en"/>
     </tstamp>
     <target name="installer.debian" depends="" description="build release deb file for the Debian,Ubuntu">
-
-	<copy todir="${debian.work.dir}/debian">
-	  <fileset dir="${debian.dir}/" includes="**/*"/>
-	  <filterset>
-	    <filter token="builddate" value="${debian.builddate}"/>
-	    <filter token="version" value="${debian.version}"/>
-	  </filterset>
-	</copy>
-
-	<copy todir="${debian.work.dir}/documentation/">
-   	   <fileset dir="${basedir}/documentation/" includes="**/*"/>
-	</copy>
-
-	<copy todir="${debian.work.dir}/src/">
-   	   <fileset dir="${basedir}/src/" includes="**/*"/>
-	</copy>
-
-	<copy todir="${debian.work.dir}/build/">
-   	   <fileset dir="${basedir}/build/" includes="**/*"/>
-	</copy>
-
-        <chmod file="${debian.work.dir}/debian/rules" perm="755"/>
-	<exec executable="dpkg-buildpackage" dir="${debian.work.dir}" failonerror="false">
-	  <arg line="-d"/>
-	</exec>
-
-	<mkdir dir="${debian.release.dir}"/>
+	
+		<copy todir="${debian.work.dir}/debian">
+		  <fileset dir="${debian.dir}/" includes="**/*"/>
+		  <filterset>
+		    <filter token="builddate" value="${debian.builddate}"/>
+		    <filter token="version" value="${debian.version}"/>
+		  </filterset>
+		</copy>
+	
+		<copy todir="${debian.work.dir}/documentation/">
+	   	   <fileset dir="${basedir}/documentation/" includes="**/*"/>
+		</copy>
+	
+		<copy todir="${debian.work.dir}/src/">
+	   	   <fileset dir="${basedir}/src/" includes="**/*"/>
+		</copy>
+	
+		<copy todir="${debian.work.dir}/build/">
+	   	   <fileset dir="${basedir}/build/" includes="**/*"/>
+		</copy>
+	
+	        <chmod file="${debian.work.dir}/debian/rules" perm="755"/>
+		<exec executable="dpkg-buildpackage" dir="${debian.work.dir}" failonerror="false">
+		  <arg line="-d"/>
+		</exec>
+	
+		<mkdir dir="${debian.release.dir}"/>
 
         <copy todir="${debian.release.dir}">
           <fileset dir="${debian.work.dir}/.." followsymlinks="false">
@@ -655,6 +674,120 @@
           </fileset>
         </copy>
     </target>
+	
+    <!-- IzPack package ========================================================================= -->
+	  
+	<target name="installer.izpack" depends="jar" description="build release a izpack installer">
+		<mkdir dir="${basedir}/installer/" />
+	    <taskdef name="IzPack" 
+	             classpath="${installer.izpack.dir}/lib/standalone-compiler.jar"
+				 classname="com.izforge.izpack.ant.IzPackTask"/>
+			
+		<taskdef name="launch4j" 
+				 classname="net.sf.launch4j.ant.Launch4jTask"
+				 classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
+		
+		<copy file="${basedir}/build/installer/izpack/launch4j.tmpl" tofile="${basedir}/build/installer/izpack/launch4j.xml" />
+		<copy file="${basedir}/build/installer/izpack/launch4j-starter.tmpl" tofile="${basedir}/build/installer/izpack/launch4j-starter.xml" />
+		
+    	<replace file="${basedir}/build/installer/izpack/launch4j.xml" token="@SPARKDIR@" value="${basedir}/target/build/" />
+    	<replace file="${basedir}/build/installer/izpack/launch4j-starter.xml" token="@SPARKDIR@" value="${basedir}/target/build/" />
+		
+		<launch4j configFile="${basedir}/build/installer/izpack/launch4j.xml" tmpdir="${basedir}" />
+		<launch4j configFile="${basedir}/build/installer/izpack/launch4j-starter.xml" tmpdir="${basedir}" />
+			 
+		<IzPack input="${basedir}/build/installer/spark-izpack.xml" output="${basedir}/installer/spark-installer.jar" 
+				installerType="standard" izPackDir="${installer.izpack.dir}" basedir="${basedir}"/>
+	</target>
+	
+	
+	<!-- dist.src =============================================================================== -->
+	<property name="release.src.out.dir" value="target/src/Spark-${version}" />
+    <property name="release.fullname.src" value="spark_src_${version}"/>
+    <target name="dist.src" depends="release.javadocs" description="Creates a source distribution package">
+
+	<mkdir dir="${release.dir}"/>
+
+        <!-- Copy non-java source -->
+        <copy todir="${release.src.out.dir}/src">
+            <fileset dir="${basedir}/src/" excludes="**/*.java"/>
+        </copy>
+
+        <!-- Copy java source -->
+        <copy todir="${release.src.out.dir}/src">
+            <fileset dir="${basedir}/src/">
+                <include name="**/*.java" />
+            </fileset>
+            <filterset>
+                <filter token="DATE" value="${builddate}"/>
+            </filterset>
+        </copy>
+
+        <!-- Copy documentation -->
+        <copy todir="${release.src.out.dir}/documentation">
+            <fileset dir="${basedir}/target/build/documentation/"/>
+        </copy>
+
+        <!-- Copy build -->
+        <copy todir="${release.src.out.dir}/build">
+            <fileset dir="${basedir}/build"/>
+        </copy>
+
+         <!-- Source Packages -->
+         <zip zipfile="${release.dir}/${release.fullname.src}.zip"
+                 basedir="${release.src.out.dir}/.."
+                 includes="**/*"
+                 />
+         <tar tarfile="${release.dir}/${release.fullname.src}.tar.gz"
+                 basedir="${release.src.out.dir}/.."
+                 includes="**/*"
+                 compression="gzip"
+                 longfile="gnu"
+                />
+
+    </target>
+	
+    <!-- installer.rpm ========================================================================= -->
+    <property name="bundle.jre" value="true" />
+    <property name="target.work.subdir" value="rpm" />
+    <property name="target.rpm" value="${work.dir}/${target.work.subdir}" />
+    <property name="rpm.spec.file" value="${basedir}/build/rpm/spark.spec"/>
+    <tstamp>
+        <format property="rpm.builddate" pattern="EEE MMM dd yyyy" locale="en"/>
+    </tstamp>
+    <target name="installer.rpm" depends="dist.src" description="Builds a rpm of spark.">
+
+        <mkdir dir="${target.rpm}/SPECS" />
+        <mkdir dir="${target.rpm}/SOURCES" />
+        <mkdir dir="${target.rpm}/BUILD" />
+        <mkdir dir="${target.rpm}/SRPMS" />
+        <mkdir dir="${target.rpm}/RPMS" />
+
+        <copy tofile="${target.rpm}/SPECS/spark.spec" file="${rpm.spec.file}" />
+        <if>
+            <equals arg1="${bundle.jre}" arg2="true"/>
+            <then>
+                <!-- Include bundled jre -->
+                <copy todir="${target.rpm}/SOURCES" file="${basedir}/build/rpm/jre-dist.tar.gz" />
+            </then>
+        </if>
+        <copy todir="${target.rpm}/SOURCES" file="${release.dir}/${release.fullname.src}.tar.gz" />
+
+
+        <rpm specFile="spark.spec"
+             topDir="${target.rpm}"
+             command="-ba --define 'SPARK_VERSION ${version}' --define 'SPARK_SOURCE ${release.fullname.src}.tar.gz'"
+             failOnError="true"
+             />
+
+        <copy todir="${release.dir}" >
+            <fileset dir="${target.rpm}/SRPMS" />
+            <fileset dir="${target.rpm}/" >
+            	<include name="**/*.rpm"/>
+            </fileset>
+        </copy>
+    </target>
+	
 </project>
 
 
Index: build/rpm/spark.spec
===================================================================
--- build/rpm/spark.spec	(revision 0)
+++ build/rpm/spark.spec	(revision 0)
@@ -0,0 +1,123 @@
+Name: Spark
+Summary: Spark RPM-Paket
+Version: %{SPARK_VERSION}
+Release: 1
+License: GPL
+Group: misc/Spark
+Source: %{SPARK_SOURCE}
+Source1: jre-dist.tar.gz
+BuildRoot: %{_tmppath}/build-root-%{name}
+Packager: igniterealtime.org
+Distribution: Linux
+Prefix: /usr/share
+Url: http://www.igniterealtime.org/downloads/source.jsp
+
+%define prefix /usr/share
+%define homedir %{prefix}/spark
+
+%description
+Instant Messenger
+
+%prep
+%setup -q spark_src
+
+%build
+cd build
+ant jar
+cd ..
+
+
+%install
+# Prep the install location.
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+
+# Copy over the main install tree.
+cp -R target/build $RPM_BUILD_ROOT%{homedir}
+
+mkdir -p $RPM_BUILD_ROOT/usr/bin/
+
+#pushd $RPM_BUILD_ROOT%{homedir}
+cd $RPM_BUILD_ROOT%{homedir}
+gzip -cd %{SOURCE1} | tar xvf -
+#popd
+
+echo "#!/bin/bash" > $RPM_BUILD_ROOT/usr/bin/spark
+echo "SPARKDIR=/usr/share/spark/" >> $RPM_BUILD_ROOT/usr/bin/spark
+echo "/usr/share/spark/jre/bin/java -Dappdir=\$SPARKDIR -cp \$SPARKDIR/lib/linux/jmf.jar:\$SPARKDIR/lib/startup.jar:\$SPARKDIR/lib/linux/jdic.jar:\$SPARKDIR/resources org.jivesoftware.launcher.Startup" >> $RPM_BUILD_ROOT/usr/bin/spark
+
+chmod -R 755 $RPM_BUILD_ROOT/usr/bin/spark
+
+rm -r $RPM_BUILD_ROOT/usr/share/spark/lib/windows
+
+# Force a happy exit even if openfire condrestart script didn't exit cleanly.
+exit 0
+
+
+%files
+%dir /usr/bin/spark
+%dir /usr/share/spark/bin
+%dir /usr/share/spark
+%dir /usr/share/spark/xtra
+/usr/share/spark/bin/*
+%dir /usr/share/spark/documentation/
+/usr/share/spark/documentation/*
+%dir /usr/share/spark/documentation/images/
+/usr/share/spark/documentation/images/*
+%dir  /usr/share/spark/lib
+/usr/share/spark/lib/activation.jar
+/usr/share/spark/lib/asterisk-im-client.jar
+/usr/share/spark/lib/base.jar
+/usr/share/spark/lib/dom4j.jar
+/usr/share/spark/lib/i4jruntime.jar
+%dir /usr/share/spark/lib/linux/
+/usr/share/spark/lib/linux/jdic.jar
+/usr/share/spark/lib/linux/jmf.jar
+/usr/share/spark/lib/linux/libjdic.so
+/usr/share/spark/lib/linux/libmozembed-linux-gtk1.2.so
+/usr/share/spark/lib/linux/libmozembed-linux-gtk2.so
+/usr/share/spark/lib/linux/libtray.so
+/usr/share/spark/lib/linux/mozembed-linux-gtk1.2
+%dir /usr/share/spark/lib/mac/
+/usr/share/spark/lib/mac/JavaSoundStream.fix.jar
+/usr/share/spark/lib/mac/jmf.jar
+/usr/share/spark/lib/mac/libSystemUtilities.jnilib
+/usr/share/spark/lib/smack.jar
+/usr/share/spark/lib/smackx-debug.jar
+/usr/share/spark/lib/smackx.jar
+/usr/share/spark/lib/spark.jar
+/usr/share/spark/lib/startup.jar
+/usr/share/spark/lib/swingx.jar
+/usr/share/spark/lib/synthetica.jar
+/usr/share/spark/lib/syntheticaBlueMoon.jar
+/usr/share/spark/lib/systeminfo.jar
+/usr/share/spark/lib/xpp.jar
+/usr/share/spark/lib/xstream.jar
+%dir /usr/share/spark/logs/
+%doc /usr/share/spark/logs/error.log
+%dir /usr/share/spark/plugins/
+/usr/share/spark/plugins/idlelinux.jar
+/usr/share/spark/plugins/jingle.jar
+/usr/share/spark/plugins/jniwrapper.jar
+/usr/share/spark/plugins/spelling-plugin.jar
+%dir /usr/share/spark/resources/
+/usr/share/spark/resources/Info.plist
+/usr/share/spark/resources/jniwrap.dll
+/usr/share/spark/resources/jniwrap.lic
+%dir /usr/share/spark/resources/sounds/
+/usr/share/spark/resources/sounds/bell.wav
+/usr/share/spark/resources/sounds/chat_request.wav
+/usr/share/spark/resources/sounds/incoming.wav
+/usr/share/spark/resources/sounds/outgoing.wav
+/usr/share/spark/resources/sounds/presence_changed.wav
+/usr/share/spark/resources/startup.sh
+/usr/share/spark/resources/systeminfo.dll
+%dir /usr/share/spark/xtra/emoticons/ 
+/usr/share/spark/xtra/emoticons/Default.adiumemoticonset.zip
+/usr/share/spark/xtra/emoticons/GTalk.AdiumEmoticonset.zip
+/usr/share/spark/xtra/emoticons/POPO.adiumemoticonset.zip
+/usr/share/spark/xtra/emoticons/sparkEmoticonSet.zip
+%{homedir}/jre
+
+
+
Index: src/java/org/jivesoftware/MainWindow.java
===================================================================
--- src/java/org/jivesoftware/MainWindow.java	(revision 10965)
+++ src/java/org/jivesoftware/MainWindow.java	(working copy)
@@ -324,10 +324,12 @@
 
                 command = starterExe + " \"" + sparkExe + "\"";
             }
+            if (Spark.isLinux()) {
+            	command = Spark.getBinDirectory().getParentFile().getCanonicalPath() + File.separator + "spark";
+            }
             else if (Spark.isMac()) {
                 command = "open -a Spark";
             }
-
             Runtime.getRuntime().exec(command);
         }
         catch (IOException e) {
@@ -383,10 +385,8 @@
         });
 
 
-        if (Spark.isWindows()) {
-            connectMenu.add(logoutMenuItem);
-            connectMenu.add(logoutWithStatus);
-        }
+        connectMenu.add(logoutMenuItem);
+        connectMenu.add(logoutWithStatus);
 
         connectMenu.addSeparator();
 
Index: build/installer/spark-izpack.xml
===================================================================
--- build/installer/spark-izpack.xml	(revision 0)
+++ build/installer/spark-izpack.xml	(revision 0)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
+<installation version="1.0">
+    <info>
+        <appname>Spark</appname>
+        <appversion>2.6.0</appversion>
+        <url>http://www.igniterealtime.org</url>
+        <!--<pack200/>-->
+    </info>
+    
+    <guiprefs width="640" height="480" resizable="no" />
+    
+    <variables>
+        <variable name="DesktopShortcutCheckboxEnabled" value="true" />
+        <variable name="ApplicationShortcutPath" value="ApplicationShortcuts" />
+    </variables>
+
+	<locale>
+       	<langpack iso3="eng"/>
+        <langpack iso3="fra"/>
+        <langpack iso3="deu"/>
+        <langpack iso3="ita"/>
+        <langpack iso3="jpn"/>
+        <langpack iso3="spa"/>
+        <langpack iso3="dan"/>
+        <langpack iso3="ell"/>
+        <langpack iso3="cat"/>
+        <langpack iso3="ned"/>
+        <langpack iso3="fin"/>
+        <langpack iso3="swe"/>
+        <langpack iso3="por"/>
+        <langpack iso3="pol"/>
+        <langpack iso3="rus"/>
+        <langpack iso3="ukr"/>
+        <langpack iso3="hun"/>
+        <langpack iso3="svk"/>
+        <langpack iso3="rom"/>
+        <langpack iso3="mys"/>
+        <langpack iso3="nor"/>
+        <langpack iso3="chn"/>
+        <langpack iso3="scg"/>
+        <langpack iso3="cze"/>
+        <langpack iso3="kor"/>
+        <langpack iso3="glg"/> 
+    </locale>
+    
+    <resources>
+    	<res src="documentation/LICENSE.html" id="HTMLLicencePanel.licence"/>
+		<res src="build/installer/izpack/default_shortcutSpec.xml" id="shortcutSpec.xml"/>
+		<res src="build/installer/izpack/unix_shortcutSpec.xml" id="Unix_shortcutSpec.xml"/>
+		<res src="build/installer/izpack/RegistrySpec.xml" id="RegistrySpec.xml"/>
+    </resources>
+    
+	<panels>
+		<panel classname="HTMLLicencePanel" />
+        <panel classname="TargetPanel" />
+        <panel classname="PacksPanel" />
+        <panel classname="InstallPanel" />
+		<panel classname="ShortcutPanel" />
+        <panel classname="FinishPanel" />
+    </panels>
+    
+    <listeners>
+    	<listener installer="RegistryInstallerListener"
+                  uninstaller="RegistryUninstallerListener">
+            <os family="windows"/>
+        </listener>
+	</listeners>
+	        
+    <packs>
+        <pack name="Spark" required="yes">
+        	<description>XMPP Client</description>
+        	<file src="src/resources/images/spark.ico"			targetdir="$INSTALL_PATH/resources/"/>
+        	<file src="src/resources/images/spark-32x32.png"	targetdir="$INSTALL_PATH/resources/"/>
+        	<file src="target/build/Spark.exe"					targetdir="$INSTALL_PATH" os="windows"/>
+        	<file src="target/build/starter.exe"				targetdir="$INSTALL_PATH" os="windows"/>
+        	<file src="build/installer/izpack/spark" 			targetdir="$INSTALL_PATH" os="unix"/>
+        	<file src="target/build/lib" 						targetdir="$INSTALL_PATH"/>
+        	<file src="target/build/logs"						targetdir="$INSTALL_PATH"/>
+        	<file src="target/build/plugins" 					targetdir="$INSTALL_PATH"/>
+        	<file src="target/build/resources" 					targetdir="$INSTALL_PATH"/>
+        	<file src="target/build/xtra" 						targetdir="$INSTALL_PATH"/>
+        	
+        	<parsable targetfile="$INSTALL_PATH/spark" os="unix"/>
+        	<parsable targetfile="$INSTALL_PATH/starter" os="unix"/>
+        	
+        	<executable targetfile="$INSTALL_PATH/spark" os="unix"/>
+        	<executable targetfile="$INSTALL_PATH/starter.exe" 	os="windows"/>
+        	<executable targetfile="$INSTALL_PATH/Spark.exe" 	os="windows"/>
+    	</pack>    
+	</packs>
+	
+	<!-- The native libraries to add -->
+    <native type="izpack" name="ShellLink.dll"/>
+    <native type="izpack" name="ShellLink_x64.dll"/>
+    <native type="3rdparty" name="COIOSHelper.dll" stage="both">
+        <os family="windows"/>
+    </native>
+            
+</installation>
Index: src/java/org/jivesoftware/Restarter.java
===================================================================
--- src/java/org/jivesoftware/Restarter.java	(revision 10965)
+++ src/java/org/jivesoftware/Restarter.java	(working copy)
@@ -31,7 +31,7 @@
         if (args.length == 0) {
             return;
         }
-
+        System.out.println(args[0]);
         File file = new File(args[0]);
         if (!file.exists()) {
             return;
@@ -46,10 +46,13 @@
 
         try {
             String command = "";
-            if (Spark.isWindows()) {
+            if (isWindows()) {
                 command = file.getCanonicalPath();
             }
-            else if (Spark.isMac()) {
+            if (isLinux()) {
+                command = file.getCanonicalPath();
+            }
+            else if (isMac()) {
                 command = "open -a Spark";
             }
 
@@ -60,7 +63,47 @@
         }
 
     }
+    
+    /**
+     * Return if we are running on windows.
+     *
+     * @return true if we are running on windows, false otherwise.
+     */
+    public static boolean isWindows() {
+        final String osName = System.getProperty("os.name").toLowerCase();
+        return osName.startsWith("windows");
+    }
+
+    /**
+     * Returns true if Spark is running on vista.
+     *
+     * @return true if running on Vista.
+     */
+    public static boolean isVista() {
+        final String osName = System.getProperty("os.name").toLowerCase();
+        return osName.contains("vista");
+    }
 
+    /**
+     * Return if we are running on a mac.
+     *
+     * @return true if we are running on a mac, false otherwise.
+     */
+    public static boolean isMac() {
+        String lcOSName = System.getProperty("os.name").toLowerCase();
+        return lcOSName.indexOf("mac") != -1;
+    }
+    
+    /**
+     * Return if we are running on Linux.
+     *
+     * @return true if we are running on Linux, false otherwise.
+     */
 
+    public static boolean isLinux() {
+        final String osName = System.getProperty("os.name").toLowerCase();
+        return osName.startsWith("linux");
+    }
+    
 }
 
Index: build/installer/izpack/unix_shortcutSpec.xml
===================================================================
--- build/installer/izpack/unix_shortcutSpec.xml	(revision 0)
+++ build/installer/izpack/unix_shortcutSpec.xml	(revision 0)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<shortcuts>
+	<skipIfNotSupported/>
+	<programGroup defaultName="Spark" location="applications"/>
+	
+	<shortcut
+		name="Spark"
+		programGroup="yes"
+		desktop="no"
+		applications="no"
+		startMenu="no"
+		startup="no"
+		target="$INSTALL_PATH/spark"
+		commandLine=""
+		type="Application"
+        encoding="UTF-8"
+        KdeSubstUID="true"
+		workingDirectory="$INSTALL_PATH/"
+		description="Spark"
+		iconIndex="0"
+		iconFile="$INSTALL_PATH/resources/spark-32x32.png"
+		initialState="noShow">
+  		description="Spark - XMPP Client"
+		<createForPack name="Spark"/>
+	</shortcut>
+	
+	<shortcut
+            name="Spark Uninstaller"
+            programGroup="yes"
+            desktop="no"
+            applications="no"
+            startMenu="no"
+            startup="no"
+            target="java"
+            commandLine="-jar &quot;$INSTALL_PATH/Uninstaller/uninstaller.jar&quot;"
+            iconFile="trashcan_full"
+            iconIndex="0"
+            type="Application"
+            encoding="UTF-8"
+            KdeSubstUID="true"
+            workingDirectory=""
+            description="This uninstalls Spark @build.number@">
+		<createForPack name="Spark"/>
+	</shortcut>
+	
+</shortcuts>
Index: build/installer/izpack/launch4j-starter.tmpl
===================================================================
--- build/installer/izpack/launch4j-starter.tmpl	(revision 0)
+++ build/installer/izpack/launch4j-starter.tmpl	(revision 0)
@@ -0,0 +1,46 @@
+<launch4jConfig>
+  <dontWrapJar>true</dontWrapJar>
+  <headerType>gui</headerType>
+  <jar>lib/spark.jar</jar>
+  <outfile>@SPARKDIR@/starter.exe</outfile>
+  <errTitle>Spark</errTitle>
+  <cmdLine></cmdLine>
+  <chdir>.</chdir>
+  <priority>normal</priority>
+  <downloadUrl>http://java.com/download</downloadUrl>
+  <supportUrl></supportUrl>
+  <customProcName>false</customProcName>
+  <stayAlive>true</stayAlive>
+  <manifest></manifest>
+  <icon>@SPARKDIR@/../../src/resources/images/spark.ico</icon>
+  <classPath>
+    <mainClass>org.jivesoftware.Restarter</mainClass>
+    <cp>./lib/spark.jar</cp>
+  </classPath>
+  <jre>
+    <path>./jre/</path>
+    <minVersion>1.6.0</minVersion>
+    <maxVersion></maxVersion>
+    <jdkPreference>preferJre</jdkPreference>
+    <opt>-Dappdir=&quot;.&quot;</opt>
+  </jre>
+  <versionInfo>
+    <fileVersion>2.6.0.0</fileVersion>
+    <txtFileVersion>2.6.0</txtFileVersion>
+    <fileDescription>Spark Client</fileDescription>
+    <copyright>http://igniterealtime.org</copyright>
+    <productVersion>2.6.0.0</productVersion>
+    <txtProductVersion>2.6.0</txtProductVersion>
+    <productName>Spark</productName>
+    <companyName>Igniterealtime</companyName>
+    <internalName>Spark Client</internalName>
+    <originalFilename>starter.exe</originalFilename>
+  </versionInfo>
+  <messages>
+    <startupErr>An error occurred while starting the application.</startupErr>
+    <bundledJreErr>This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.</bundledJreErr>
+    <jreVersionErr>This application requires a Java Runtime Environment.\nAt least version</jreVersionErr>
+    <launcherErr>The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.</launcherErr>
+    <instanceAlreadyExistsMsg>An application instance is already running.</instanceAlreadyExistsMsg>
+  </messages>
+</launch4jConfig>
