Author: nextgens
Date: 2006-03-23 13:44:10 +0000 (Thu, 23 Mar 2006)
New Revision: 8290

Added:
   trunk/apps/installer/installclasspath/linux/
   trunk/apps/installer/installclasspath/linux/CreateDesktopShortcut.sh
Modified:
   trunk/apps/installer/antinstall-config.xml
   trunk/apps/installer/build.xml
   trunk/apps/installer/installclasspath/bin/run.cmd
   trunk/apps/installer/src/Sha1Test.java
Log:
installer: now the installer is bundling frost and hopefully creating desktop 
icons on both windows and linux

Modified: trunk/apps/installer/antinstall-config.xml
===================================================================
--- trunk/apps/installer/antinstall-config.xml  2006-03-22 21:57:37 UTC (rev 
8289)
+++ trunk/apps/installer/antinstall-config.xml  2006-03-23 13:44:10 UTC (rev 
8290)
@@ -93,6 +93,18 @@
                        target="tgdoc"
                        defaultValue="false"
                        force="true"/>
+               <comment
+                       displayText="Following components are 3rd party 
software"/>
+               <target
+                       displayText="FUQID"
+                       target="fuqid"
+                       defaultValue="false"
+                       force="true"/>
+               <target
+                       displayText="Frost"
+                       target="frost"
+                       defaultValue="true"
+                       force="false"/>
        </page>
        <page
                        ifProperty="${l33t}!=2"

Modified: trunk/apps/installer/build.xml
===================================================================
--- trunk/apps/installer/build.xml      2006-03-22 21:57:37 UTC (rev 8289)
+++ trunk/apps/installer/build.xml      2006-03-23 13:44:10 UTC (rev 8290)
@@ -11,6 +11,9 @@
                <condition property="target" value="config_default" 
else="config_l33t">
                        <equals arg1="${l33t}" arg2="0"/>
                </condition>
+               <condition property="skip_frost" value="true">
+                       <equals arg1="${frost}" arg2="false"/>
+               </condition>
        </target>

        <target name="config_default">
@@ -39,7 +42,7 @@
                </replace>
        </target>

-       <target name="default" depends="pre,tgmain,tgext">
+       <target name="default" depends="pre,tgmain,tgext,frost">
                <copy file="${basedir}/bin/run.sh"  
tofile="${installDir}/run.sh"/>
                <copy file="${basedir}/bin/run.cmd"  
tofile="${installDir}/run.cmd"/>
                <chmod file="${installDir}/run.sh" perm="775"/>
@@ -50,10 +53,23 @@
                <antcall target="${target}"/>

                <echo message="Creating shortcuts"/>
-               <exec os="windows" executable="CreateDesktopShortcut.vbs" 
dir="${installDir}/">
+               <exec os="windows" executable="CreateDesktopShortcut.vbs" 
dir="${installDir}/windows">
                        <arg value="${installDir}"/>
                </exec>
+               <exec os="Linux" executable="CreateDesktopShortcut.sh" 
dir="${installDir}/linux">
+                       <arg value="${installDir}"/>
+               </exec>
        </target>
+
+       <target name="frost" unless="skip_frost">
+               <echo message="Downloading Frost"/>
+               
+               <java classpath="${basedir}/sha1test.jar" classname="Sha1Test" 
failonerror="true" fork="true" resultproperty="frost.verified" logError="true">
+                       <arg value="frost/frost.tbz"/>
+               </java>
+
+               <untar src="${basedir}/frost.tbz" dest="${installDir}" 
compression="bzip2"/>
+       </target>

        <target name="tgmain" >
                <echo message="Downloading core components"/>

Modified: trunk/apps/installer/installclasspath/bin/run.cmd
===================================================================
--- trunk/apps/installer/installclasspath/bin/run.cmd   2006-03-22 21:57:37 UTC 
(rev 8289)
+++ trunk/apps/installer/installclasspath/bin/run.cmd   2006-03-23 13:44:10 UTC 
(rev 8290)
@@ -7,7 +7,7 @@
 echo CLASSPATH:%CLASSPATH%
 echo JAVA_HOME:%JAVA_HOME%

-%JAVA_HOME%\bin\java -cp %CLASSPATH% -Xmx256m freenet.node.Node
+java -cp %CLASSPATH% -Xmx256m freenet.node.Node

 goto end


Added: trunk/apps/installer/installclasspath/linux/CreateDesktopShortcut.sh
===================================================================
--- trunk/apps/installer/installclasspath/linux/CreateDesktopShortcut.sh        
2006-03-22 21:57:37 UTC (rev 8289)
+++ trunk/apps/installer/installclasspath/linux/CreateDesktopShortcut.sh        
2006-03-23 13:44:10 UTC (rev 8290)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+mkdir -p $HOME/Desktop
+ln -s $0/run.sh $HOME/Desktop/Start-Freenet
+chmod 755 $0/run.sh

Modified: trunk/apps/installer/src/Sha1Test.java
===================================================================
--- trunk/apps/installer/src/Sha1Test.java      2006-03-22 21:57:37 UTC (rev 
8289)
+++ trunk/apps/installer/src/Sha1Test.java      2006-03-23 13:44:10 UTC (rev 
8290)
@@ -5,19 +5,22 @@

 public class Sha1Test {
        protected static int BUFFERSIZE=8192;
+       private static final String base = new 
String("http://downloads.freenetproject.org/alpha/";);

        public static void main(String[] args) {
-               final String file= args[0];
+               final String URI2 = args[0];
                int count = 0;
-               if(file == null) System.exit(2);
+               if(URI2 == null) System.exit(2);

+               String filename = (new File(URI2)).getName();
+
                while(count<3){
-                       get(file);
-                       get(file+".sha1");
-                       if(sha1test(file)) System.exit(0);
+                       get(URI2, filename);
+                       get(URI2+".sha1", filename+".sha1");
+                       if(sha1test(filename)) System.exit(0);
                        count++;
                }
-               System.out.println("No mirror is aviable at the moment, please 
try again later");
+               System.out.println("No mirror is available at the moment, 
please try again later");
                System.exit(1);
        }

@@ -76,17 +79,17 @@
        }


-       public static void get(String file) {
+       public static void get(String file, String filename) {
                URL url;
                InputStream is = null;
                DataInputStream dis;
                String s;

                try {
-                       url = new 
URL("http://downloads.freenetproject.org/alpha/"+file);
+                       url = new URL(base+file);
                        is = url.openStream();         // throws an IOException
                        dis = new DataInputStream(new BufferedInputStream(is));
-                       File f = new File(file);
+                       File f = new File(filename);
                        BufferedOutputStream os = new BufferedOutputStream(new 
FileOutputStream(f));
                        int b;
                        while ((b = dis.read()) != -1) {
@@ -101,6 +104,7 @@
                        System.exit(2);

                } catch (Exception ioe) {
+                       System.out.println(ioe);
                } finally {
                        try {
                                is.close();


Reply via email to