Archive: Problem running NSIS from ant task


Problem running NSIS from ant task
I have a working nsis script it runs fine in eclipse and standlone from the command line however when I run it from ant I get an io exception

[nsis] java.io.IOException: CreateProcess: makensis /V4 /DPROD_BUILD_NUMBER=212 "C:\Documents and Settings\angusn\workspace\aisloader_build\installer\install.nsi" error=2
[nsis] at java.lang.ProcessImpl.create(Native Method)
[nsis] at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
[nsis] at java.lang.ProcessImpl.start(ProcessImpl.java:30)
[nsis] at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
[nsis] at java.lang.Runtime.exec(Runtime.java:591)
[nsis] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[nsis] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[nsis] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[nsis] at java.lang.reflect.Method.invoke(Method.java:585)
[nsis] at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:828)
[nsis] at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
[nsis] at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
[nsis] at net.sf.nsisant.Task.execute(Unknown Source)
[nsis] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[nsis] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[nsis] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[nsis] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[nsis] at java.lang.reflect.Method.invoke(Method.java:585)
[nsis] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[nsis] at org.apache.tools.ant.Task.perform(Task.java:348)
[nsis] at org.apache.tools.ant.Target.execute(Target.java:357)
[nsis] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[nsis] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[nsis] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[nsis] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[nsis] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[nsis] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[nsis] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[nsis] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

this is my taskdef

<taskdef name="nsis" classname="net.sf.nsisant.Task">
<classpath location="lib/nsisant-1.2.jar"/>
</taskdef>


my target is :

<target name="installer" depends="deployZip">
<nsis script="${deployInstallWorkDir}/install.nsi" verbosity="4">
<define name="PROD_BUILD_NUMBER" value="${build.number}"/>
</nsis>
</target>



I have a workaround calling the makensis as an exec task but any suggestions to have it woking as a task would be appreciated. This is the first time I have used nsis so if I have missed something obvious be gentle with me :)


Thanks


Looks to me like it doesn't find makensis.exe. But I couldn't tell without more detailed error log. Maybe the author of NSISAnt will know more on his forum.