Hi, all

I have an exec task which runs the Installshield command line utility to build the 
installation for my app.  Mostly, this is a standard task which I would like to put 
into a common build file.  However, each project might need to pass different 
parameters.  I want the task to only pass each parameter if the relevant property is 
defined:

<exec program="C:\Program Files\InstallShield X\System\IsCmdBld.exe">
        <arg value="-p &quot;${prj.ism}&quot;"/>
        <arg value="-b &quot;${prj.out}&quot;" if="${property::exists('prj.out')}"/>
</exec>

This particular <arg> tag tells it to build the installation to the location specified 
in the property prj.out.  If that property is not defined, then it will use the 
default location by not passing this parameter.  (The -p parameter is always required, 
which is why that doesn't have an if attribute).  However, this doesn't work since the 
value attribute uses the prj.out property, which might not exist, and the properties 
in this attribute are expanded even if the condition evaluates to false.

I tried this (just on an off-chance):

<exec program="C:\Program Files\InstallShield X\System\IsCmdBld.exe">
        <arg value="-p &quot;${prj.ism}&quot;"/>
        <if test="${property::exists('prj.out')}">
                <arg value="-b &quot;${prj.out}&quot;"/>
        </if>
</exec>

which stops it failing, but the <arg> element is never actually used.

Any ideas?

Thanks

**********************************************************************
Privileged/Confidential Information may be contained in this 
message. If you are not the addressee indicated in this 
message (or responsible for delivery of the message to such 
person), you must not copy, distribute or take any action in 
reliance to it.
In such case, you should destroy this message and kindly 
notify the sender by reply email. Please advise immediately 
if you or your employer do not consent to Internet email for 
messages of this kind. Opinions, conclusions and other 
information in this message that do not relate to the official 
business of Minorplanet Systems Plc shall be understood as 
neither given nor endorsed by it.
**********************************************************************



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to