You would have to do a custom action to set the property from a property
and you can condition the execution of that.
<CustomAction Id="Set_MYOLDSETTINGS" Property="MYOLDSETTINGS"
Value="[MYOLDVER]\Settings"/>
<Custom Action="Set_MYOLDSETTINGS" Execute="immediate"
Before="CopyFiles" >MYOLDVER</Custom>
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Levi
Wilson
Sent: Thursday, January 25, 2007 11:53 AM
To: Lorne Laliberte
Cc: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] <CopyFile/> vs. CA
This does help, thank you! One caveat to this, the old
installation has a registry key named "Path" that contains the path to
its installation directory. The settings folder is would be in a
settings subdirectory of this. In the <CopyFile/> I cannot reference
this like "[MYOLDVER]\settings" since it violates the pattern of
SourceProperty. Also, I cannot set my SourceName="settings\*.*" either
because the '\' violates that property. I'm sorry if I'm being obtuse
about this, but do I need to set ANOTHER property as well? What would
happen if I had this:
<Property Id="MYOLDVER">
<RegistrySearch Id="OldPathSearch" Type="directory"
Root="HKLM" Key="whatever" Name="Path" />
</Property>
<Property Id="MYOLDSETTINGS" Value="[MYOLDVER]\Settings" />
Wouldn't my "MYOLDSETTINGS" property be set to "\Settings" if
"MYOLDVER" was empty? I would try this, but I don't have an environment
setup with this yet. Thanks for the help!
On 1/25/07, Lorne Laliberte <[EMAIL PROTECTED]> wrote:
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: wix-users@lists.sourceforge.net
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
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users