Hello Jim,
Thank you for your help. I'm trying to make changes in my script according to your hint. I found one problem. The next script:
<property name="IsComponent1Selected" value="0"/>
<if propertytrue="ShouldIncludeComponent1"> <property name="IsComponent1Selected" value="2" /> </if>
<features> <feature ... display="${IsComponent1Selected}" ... /> </features>
results to the error: "Validation error: The "display" attribute has an invalid value according to its data type."
I tried also:
<features> <feature ... display="${int::parse( IsComponent1Selected )}" ... /> </features>
and received the same error.
Any idea what is wrong?
Regards, Roman.
----- Original Message ----- From: "James Geurts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, November 10, 2004 3:29 PM
Subject: Re: [Nant-users] MSI Task - question
Hi Roman, I sort of have an answer for you. The task doesn't directly support if conditions like how you want, but it is possible.
If you set the display attribute's value to 0 for a feature, the feature
will not be visible to the user. Also, you can add if conditions to the
<include element of a merge module. So, to programmatically specify if a
feature & merge module should be available to a user, you could do something
like the following:
<target name="mytarget"> <property name="IsComponent1Selected" value="0" /> <if propertytrue="ShouldIncludeComponent1"> <property name="IsComponent1Selected" value="1" /> </if> <msi ...> . . . <features> <feature name="F__MainFeature" title="Main Feature" display="1" typical="true" directory="D__MainDirectory" /> <feature name="F__Component1Feature" title="Component 1 Feature" display="${IsComponent1Selected}" typical="true" directory="D__SubDir" />
</features>
<mergemodules> <merge feature="F__Component1Feature"> <modules> <include name="MergeModule_1.msm" if="${ShouldIncludeComponent1}" /> </modules> </merge> </mergemodules>
</msi> </target>
Something along those lines... Let me know if something is unclear, etc.
Jim
Hello,
I need an advise...
Our company sells software components. Every our customer (depending on his needs) may want to buy different combination of components.
I would like to create a script that would include these components into MSI file depending on the value (true / false) of some property that I can specify when running script. In this case I would be able to use the same main script (plus *.include module per component) to create a MSI file with any combination of software components. The include module for each component would have targets for getting of source code from source control system, compilation, building doc, building merge module, etc. The main script would check external properties, call targets from *.include modules, and merge necessary components to MSI file.
The scenario described above works very well except the MSI task. It seems it does not let to use if="some condition" to include features and merge modules like in the script below:
<features>
<feature name="FEATURE_1" if="${component_1.selected}" ...> <description>Description of Feature 1</description> </feature>
<feature name="FEATURE_2" if="${component_2.selected}" ...> <description>Description of Feature 2</description> </feature>
</features>
<mergemodules>
<merge if="${component_1.selected}" feature="FEATURE_1"> <modules> <include name="MergeModule_1.msm" /> </modules> </merge>
<merge if="${component_2.selected}" feature="FEATURE_2"> <modules> <include name="MergeModule_2.msm" /> </modules> </merge>
</mergemodules>
How can I accomplish what I need? Is any other way to use the same script to build a MSI file with an arbitrary combination of software components?
Regards, Roman.
------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users
------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users