MSFN Forum: Adding Conditional Expressions - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adding Conditional Expressions Adding Conditional Expressions Rate Topic: -----

#1 User is offline   jeremyts 

  • Group: Members
  • Posts: 4
  • Joined: 19-July 05

Posted 14 August 2005 - 09:22 PM

Hi,

Can I add conditional expressions within the include-Items.xml file?

What I would like to do is only install certain applications if the machine is an IBM, or a HP, etc. Rather than calling multiple instances of XPlode, I want to place all my apps in the one include-Items.xml file.

If this can be done, could you please provide a small piece of sample code?

Cheers,
Jeremy.


#2 User is offline   Alanoll 

  • CODE tags people, CODE tags!
  • Group: Patrons
  • Posts: 5,496
  • Joined: 25-September 03

Posted 14 August 2005 - 09:30 PM

Last i saw...the Conditions are only available in the Registered versions....but anyway....

include-items.xml is just like any other part of the XML files. If you wanted, you could copy the contents of the XML file into the one that's including it and it would work just the same. That's all XPlode does anyway (but at the point of runtime.)

#3 User is offline   jeremyts 

  • Group: Members
  • Posts: 4
  • Joined: 19-July 05

Posted 15 August 2005 - 01:31 AM

I do have a registered version, but I can't find a way (or simply just don't understand) how to do this.

I actually want to exclude the execution (installation) of certain applications based on an environment variable. I guess I can skip a program installation by first executing a batch or vbscript to check a condition, but this is not a neat and tidy way of doing things.

Does anyone have any sample code, or can explain how this can be done in XML?

Cheers,
Jeremy.

#4 User is offline   Wraith 

  • Dr. Nick
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,256
  • Joined: 01-January 04

Posted 15 August 2005 - 01:39 AM

condition="'#BLAH#' != 'cheese'"

#5 User is offline   jeremyts 

  • Group: Members
  • Posts: 4
  • Joined: 19-July 05

Posted 15 August 2005 - 06:07 AM

Sorry Wraith. I can't follow which tags it should be placed between.

I basically only want to run though this section if the MachineType environment variable == IBM.

<items>
  <item display="Broadcom Advanced Control Suite (BACS)">
 	 <execute display="Broadcom Advanced Control Suite (BACS)" desc="Installs Broadcom Advanced Control Suite (BACS)" configs="HAILSTORM,AFTERSHOCK,MYSTIQUE,FAILSAFE">
    <program>S:\IBM\Broadcom\MgmtApps\IA32\setup</program>
    <arguments>/s /v/qn</arguments>
    <hide>true</hide>
    <wait>true</wait>
 	 </execute>
  </item>
  <item display="Broadcom BASP Silent Configuration">
 	 <execute display="Broadcom BASP Silent Configuration" desc="Installs and applies the Broadcom BASP Silent Configuration" configs="HAILSTORM,AFTERSHOCK,MYSTIQUE,FAILSAFE">
    <program>S:\IBM\baspscfg\baspscfg.cmd</program>
    <arguments></arguments>
    <hide>true</hide>
    <wait>true</wait>
 	 </execute>
  </item>
  <item display="IBM ServeRAID Manager">
 	 <execute display="IBM ServeRAID Manager" desc="Installs IBM ServeRAID Manager" configs="HAILSTORM,AFTERSHOCK,MYSTIQUE,FAILSAFE">
    <program>S:\IBM\ServeRAID\manager\setup</program>
    <arguments> /s /v"/qn REBOOT=Suppress"</arguments>
    <hide>true</hide>
    <wait>true</wait>
 	 </execute>
  </item>
	</items>


Cheers,
Jeremy.

#6 User is offline   Wraith 

  • Dr. Nick
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,256
  • Joined: 01-January 04

Posted 15 August 2005 - 06:14 AM

The condition="..." statement goes into each <execute> tag.
So you can place it after the configs="..." attribute in each of them.
Alternatively, you can place all your IBM-specific stuff into another XML, and have the condition="..." statement on the <include> tag instead.

This post has been edited by Wraith: 15 August 2005 - 06:14 AM


#7 User is offline   jeremyts 

  • Group: Members
  • Posts: 4
  • Joined: 19-July 05

  Posted 15 August 2005 - 07:18 AM

Cool. Now I understand. Thanks very much Wraith. :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy