You can actually put a <Condition> element inside your <Component
Id="CopyFileComponent"> element, and set its condition that way. The
condition will apply to the entire component, which in this case
contains your <CopyFile> element.
>From the WiX docs: "Under a Component element, the condition becomes the
condition of the component."
What you want is something like this:
<Fragment>
<DirectoryRef Id="MyDir">
<Component Id="CopyFileComponent" ...>
<CopyFile/> <!-- copy file elements here -->
<Condition>MYOLDVER</Condition>
</Component>
</DirectoryRef>
</Fragment>
Hope that helps. :)
Lorne Laliberte
Indigo Rose Software
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Levi
Wilson
Sent: Thursday, January 25, 2007 9:50 AM
To: [email protected]
Subject: Re: [WiX-users] <CopyFile/> vs. CA
I forgot to mention that both versions can coexist on the
machine.
On 1/25/07, Levi Wilson <[EMAIL PROTECTED] > wrote:
If I detect an older version of a product (via a
<RegistrySearch/> and set into "MYOLDVER") I would like to take settings
files installed for that version, and copy them into the newer version's
settings folder. Would the best way be to do a CA to do this? I saw
the <CopyFile/> element, but it doesn't appear that you can specify a
condition on this. To use the copy file would I have to do this:
<Fragment>
<DirectoryRef Id="MyDir">
<Component Id="CopyFileComponent" ...>
<CopyFile/> <!-- copy file elements here -->
</Component>
</DirectoryRef>
</Fragment>
And then in my <Feature /> tree put the condition like
this:
<ComponentRef
Id="CopyFileComponent">MYOLDVER</ComponentRef>
Is that correct? Is there a better way to do this?
Thanks in advance.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users