Author: aadamchik
Date: Thu Sep 14 20:46:39 2006
New Revision: 446501

URL: http://svn.apache.org/viewvc?view=rev&rev=446501
Log:
CAY-493 - switching to NSIS

Added:
    
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/cayenne-modeler.nsi
Removed:
    incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/lib/linux/
    incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/lib/mac/
    incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/lib/windows/
    
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/launch4j-config.xml
Modified:
    
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/import/paths.xml
    
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/win-distro.xml
    
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/default.properties

Modified: 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/import/paths.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/import/paths.xml?view=diff&rev=446501&r1=446500&r2=446501
==============================================================================
--- 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/import/paths.xml
 (original)
+++ 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/import/paths.xml
 Thu Sep 14 20:46:39 2006
@@ -149,16 +149,4 @@
                <fileset dir="lib" includes="*.jar"/>
                <path refid="classpath-cayenne-lib-tools"/>
        </path>
-       
-       <path id="classpath-win-onmac">
-               <fileset dir="lib/mac" includes="launch4j*/**.jar"/>
-       </path>
-       
-       <path id="classpath-win-onlinux">
-               <fileset dir="lib/linux" includes="launch4j*/**.jar"/>
-       </path>
-
-       <path id="classpath-win-onwindows">
-               <fileset dir="lib/windows" includes="launch4j*/**.jar"/>
-       </path>
 </project>

Modified: 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/win-distro.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/win-distro.xml?view=diff&rev=446501&r1=446500&r2=446501
==============================================================================
--- 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/win-distro.xml
 (original)
+++ 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/ant/win-distro.xml
 Thu Sep 14 20:46:39 2006
@@ -28,26 +28,6 @@
        <property name="build.win" value="${build}/win"/>
        
        <target name="prepare">
-               <condition property="win-path-ref" 
value="classpath-win-onlinux">
-                       <and>
-                               <os family="unix"/>
-                               <not>
-                                       <os family="mac"/>
-                               </not>
-                       </and>
-               </condition>
-               
-               <condition property="win-path-ref" value="classpath-win-onmac">
-                       <os family="mac"/>
-               </condition>
-               
-               <condition property="win-path-ref" 
value="classpath-win-onwindows">
-                       <os family="windows"/>
-               </condition>
-               
-               <taskdef name="launch4j" classpathref="${win-path-ref}"
-                       classname="net.sf.launch4j.ant.Launch4jTask"/>
-               
                <mkdir dir="${dist.win}"/>
        </target>
        
@@ -65,8 +45,8 @@
                        <patternset excludes="**/bin/*.sh"/>
                </untar>
                
-               <copy todir="${dist.win}/${project.name}-${project.version}/bin"
-                       file="${build.win}/CayenneModeler.exe"/>
+               <move todir="${dist.win}/${project.name}-${project.version}/bin"
+                       file="${build.win}/nsis/CayenneModeler.exe"/>
                
                <zip 
destfile="${dist.base}/${project.name}-${project.version}-win.zip">
                        <fileset dir="${dist.win}"
@@ -93,18 +73,14 @@
                        </manifest>
                </jar>
                
-               <copy todir="${build.win}"
-                       
file="${cayenne.other}/platform-win32/launch4j-config.xml">
-                       <filterset>
-                               <filter token="ICON"
-                                       
value="${basedir}/${cayenne.other}/platform-win32/CayenneModeler.ico"/>
-                               <filter token="JAR" 
value="${build.win}/cayenne-modeler-all.jar"/>
-                               <filter token="EXE" 
value="${build.win}/CayenneModeler.exe"/>
-                               <filter token="PROJECT-VERSION" 
value="${project.version}"/>
-                       </filterset>
+               <mkdir dir="${build.win}/nsis"/>
+               <copy todir="${build.win}/nsis">
+                       <fileset dir="${cayenne.other}/platform-win32"/>
                </copy>
                
-               <launch4j configFile="${build.win}/launch4j-config.xml"/>
+               <exec dir="${build.win}/nsis" 
executable="${nsis.home}/makensis" failonerror="true">
+                       <arg line="cayenne-modeler.nsi"/>
+               </exec>
        </target>
 
 </project>

Modified: 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/default.properties
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/default.properties?view=diff&rev=446501&r1=446500&r2=446501
==============================================================================
--- 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/default.properties
 (original)
+++ 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-ant/default.properties
 Thu Sep 14 20:46:39 2006
@@ -4,6 +4,9 @@
 # Version of the project
 project.version = 2.0-incubating-SNAPSHOT
 
+# NSIS location on windows
+nsis.home = C:/Program Files/NSIS
+
 # Common build locations
 dist.base = dist
 site.dir = dist/site

Added: 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/cayenne-modeler.nsi
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/cayenne-modeler.nsi?view=auto&rev=446501
==============================================================================
--- 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/cayenne-modeler.nsi
 (added)
+++ 
incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/platform-win32/cayenne-modeler.nsi
 Thu Sep 14 20:46:39 2006
@@ -0,0 +1,62 @@
+; Java Launcher
+; per http://nsis.sourceforge.net/A_slightly_better_Java_Launcher
+;--------------
+
+Name "Cayenne Modeler"
+Caption "Cayenne Modeler"
+Icon "CayenneModeler.ico"
+OutFile "CayenneModeler.exe"
+ 
+SilentInstall silent
+AutoCloseWindow true
+ShowInstDetails nevershow
+ 
+;You want to change the next two lines too
+!define CLASSPATH "..\lib\modeler\cayenne-modeler.jar"
+!define CLASS "org.apache.cayenne.modeler.Main"
+ 
+Section ""
+  Call GetJRE
+  Pop $R0
+ 
+  ; change for your purpose (-jar etc.)
+  StrCpy $0 '"$R0" -classpath "${CLASSPATH}" ${CLASS}'
+  
+ 
+  SetOutPath $EXEDIR
+  Exec $0
+SectionEnd
+ 
+Function GetJRE
+;
+;  Find JRE (javaw.exe)
+;  1 - in .\jre directory (JRE Installed with application)
+;  2 - in JAVA_HOME environment variable
+;  3 - in the registry
+;  4 - assume javaw.exe in current dir or PATH
+ 
+  Push $R0
+  Push $R1
+ 
+  ClearErrors
+  StrCpy $R0 "$EXEDIR\jre\bin\javaw.exe"
+  IfFileExists $R0 JreFound
+  StrCpy $R0 ""
+ 
+  ClearErrors
+  ReadEnvStr $R0 "JAVA_HOME"
+  StrCpy $R0 "$R0\bin\javaw.exe"
+  IfErrors 0 JreFound
+ 
+  ClearErrors
+  ReadRegStr $R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" 
"CurrentVersion"
+  ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R1" 
"JavaHome"
+  StrCpy $R0 "$R0\bin\javaw.exe"
+ 
+  IfErrors 0 JreFound
+  StrCpy $R0 "javaw.exe"
+        
+ JreFound:
+  Pop $R1
+  Exch $R0
+FunctionEnd
\ No newline at end of file


Reply via email to