Author: nextgens
Date: 2006-03-28 22:40:25 +0000 (Tue, 28 Mar 2006)
New Revision: 8346

Added:
   trunk/apps/installer/installclasspath/windows/start.cmd
   trunk/apps/installer/installclasspath/windows/stop.cmd
Modified:
   trunk/apps/installer/build.xml
   trunk/apps/installer/installclasspath/windows/CreateDesktopShortcut.vbs
Log:
installer: improved shortcut creation on windows

Modified: trunk/apps/installer/build.xml
===================================================================
--- trunk/apps/installer/build.xml      2006-03-28 20:45:20 UTC (rev 8345)
+++ trunk/apps/installer/build.xml      2006-03-28 22:40:25 UTC (rev 8346)
@@ -11,8 +11,14 @@
                        <equals arg1="${l33t}" arg2="0"/>
                </condition>
                <condition property="skip_frost" value="true">
-                       <equals arg1="${frost}" arg2="false"/>
+                       <isfalse value="${frost}" />
                </condition>
+               <condition property="is_windows" value="true">
+                       <os family="windows" />
+               </condition>
+               <condition property="is_unix" value="true">
+                       <os family="unix" />
+               </condition>
        </target>

        <target name="config_default">
@@ -40,7 +46,7 @@
                </replace>
        </target>

-       <target name="default" depends="pre,tgmain,tgext,frost">
+       <target name="default" depends="pre,tgmain,tgext,windows,unix,frost">
                <mkdir dir="${installDir}/lib"/>
                <mkdir dir="${installDir}/bin"/>
                <copy todir="${installDir}/bin/">
@@ -49,10 +55,6 @@
                <copy todir="${installDir}/lib/">
                        <fileset dir="${basedir}/lib/"/>
                </copy>
-               <copy file="${basedir}/run.sh"  tofile="${installDir}/run.sh"/>
-               <copy file="${basedir}/run.cmd"  
tofile="${installDir}/run.cmd"/>
-               <chmod file="${installDir}/run.sh" perm="775"/>
-               <chmod file="${installDir}/bin/wrapper" perm="775"/>

                <copy file="${basedir}/conf/wrapper.conf"  
tofile="${installDir}/wrapper.conf"/>
                <copy file="${basedir}/freenet-cvs-snapshot.jar"  
tofile="${installDir}/freenet-cvs-snapshot.jar"/>
@@ -60,7 +62,13 @@

                <echo message="Setting up the node"/>
                <antcall target="${target}"/>
+               
+       </target>

+       <target name="windows" if="is_windows">
+               <copy file="${basedir}/run.cmd"  
tofile="${installDir}/run.cmd"/>
+               <copy file="${basedir}/windows/start.cmd"  
tofile="${installDir}/start.cmd"/>
+               <copy file="${basedir}/windows/stop.cmd"  
tofile="${installDir}/stop.cmd"/>
                <echo message="Creating shortcuts"/>
                <exec os="Windows 2003" executable="cscript" 
dir="${basedir}/windows" >
                        <arg value="CreateDesktopShortcut.vbs"/>
@@ -75,12 +83,6 @@
                        <arg value="&quot;${installDir}&quot;"/>
                </exec>

-               <chmod file="${basedir}/linux/CreateDesktopShortcut.sh" 
perm="775"/>
-               <exec os="Linux" executable="sh" dir="${basedir}/linux/">
-                       <arg value="CreateDesktopShortcut.sh"/>
-                       <arg value="&quot;${installDir}&quot;"/>
-               </exec>
-               
                <echo message="Registering as a system service if possible"/>
                <exec os="Windows 2003" executable="cmd" dir="${installDir}/" >
                        <arg value="/c"/>
@@ -94,12 +96,28 @@
                        <arg value="/c"/>
                        <arg value="run.cmd"/>
                </exec>
+       </target>
+
+       <target name="unix" if="is_unix">
+               <copy file="${basedir}/run.sh"  tofile="${installDir}/run.sh"/>
+               <chmod file="${installDir}/run.sh" perm="775"/>
+               <chmod file="${installDir}/bin/wrapper" perm="775"/>
+
+               <echo message="Creating shortcuts"/>
+               <chmod file="${basedir}/linux/CreateDesktopShortcut.sh" 
perm="775"/>
+               <exec os="Linux" executable="sh" dir="${basedir}/linux/">
+                       <arg value="CreateDesktopShortcut.sh"/>
+                       <arg value="&quot;${installDir}&quot;"/>
+               </exec>
+
+               <echo message="Registering as a system service if possible"/>
+
                <exec os="Linux" executable="sh" dir="${installDir}">
                        <arg value="run.sh"/>
                        <arg value="start"/>
                </exec>
        </target>
-
+       
        <target name="frost" unless="skip_frost">
                <echo message="Downloading Frost"/>


Modified: 
trunk/apps/installer/installclasspath/windows/CreateDesktopShortcut.vbs
===================================================================
--- trunk/apps/installer/installclasspath/windows/CreateDesktopShortcut.vbs     
2006-03-28 20:45:20 UTC (rev 8345)
+++ trunk/apps/installer/installclasspath/windows/CreateDesktopShortcut.vbs     
2006-03-28 22:40:25 UTC (rev 8346)
@@ -13,3 +13,23 @@
 link.WindowStyle = 1
 link.WorkingDirectory = INSTALL_PATH
 link.Save
+
+Set link = Shell.CreateShortcut(DesktopPath & "\start-Freenet.lnk")
+link.Arguments = "start freenet"
+link.Description = "The Free Network Project"
+link.HotKey = ""
+link.IconLocation = INSTALL_PATH & "\freenet.ico"
+link.TargetPath = "net"
+link.WindowStyle = 1
+link.WorkingDirectory = INSTALL_PATH
+link.Save
+
+Set link = Shell.CreateShortcut(DesktopPath & "\frost.lnk")
+link.Arguments = ""
+link.Description = "FROST"
+link.HotKey = ""
+link.IconLocation = INSTALL_PATH & "\frost\jtc.ico"
+link.TargetPath = "frost.sh"
+link.WindowStyle = 1
+link.WorkingDirectory = INSTALL_PATH & "\frost"
+link.Save

Added: trunk/apps/installer/installclasspath/windows/start.cmd
===================================================================
--- trunk/apps/installer/installclasspath/windows/start.cmd     2006-03-28 
20:45:20 UTC (rev 8345)
+++ trunk/apps/installer/installclasspath/windows/start.cmd     2006-03-28 
22:40:25 UTC (rev 8346)
@@ -0,0 +1,2 @@
+echo "Starting freenet"
+ at net start freenet

Added: trunk/apps/installer/installclasspath/windows/stop.cmd
===================================================================
--- trunk/apps/installer/installclasspath/windows/stop.cmd      2006-03-28 
20:45:20 UTC (rev 8345)
+++ trunk/apps/installer/installclasspath/windows/stop.cmd      2006-03-28 
22:40:25 UTC (rev 8346)
@@ -0,0 +1,2 @@
+echo "Stoping freenet"
+ at net stop freenet


Reply via email to