Stefan Krueger [MVP] a écrit :
> So you only want to condition the copy (which corresponds to a MoveFile 
> table row I guess) but not the instalaltion of the component. To do this you 
> need to put the copy element in a separate component, because rows in the 
> MoveFile table can't have conditions by themselves, instead they use 
> components as a "gate".
>
>   
I tried this out as well. With no success...
My problem is really to affect a condition to a component.
It seems that whether my condition is full filed or not, the component 
is upgraded in both cases.

This is what my code looks like:

<Property Id="ENGINECONFISINSTALLED">
  <RegistrySearch Id='EngineRegPath' Root='HKLM' 
Key='SOFTWARE\MyProduct\Engine' Name='InstallDir' Type='directory'>
    <DirectorySearch Id='FindEngineIniFilePath' Depth="2">
      <FileSearch Id='FindEngineIniFile' Name="ampm_engine.ini" />
    </DirectorySearch>
  </RegistrySearch>
</Property>

<Component Id="APM_ENGINE_CONFIG_REF" 
Guid="4C6B380E-4DFE-458C-A29F-8A0C434E7F70">
  <Condition>ENGINECONFISINSTALLED</Condition>
  <File Id="ampm_engine.ref" Name="ampm_engine.ref" KeyPath="yes" 
Source="$(var.FACT_DESTDIR)\var\config\ampm_engine.ref">
    <CopyFile Id="APM_ENGINE_CONFIG_INI" DestinationDirectory="config" 
DestinationName="amengine.ini" DestinationLongName="ampm_engine.ini" />
  </File>
  <IniFile Id="EnginePort" Action="addLine" Directory="config" 
Name="ampm_engine.ini" Section="NETWORK" Key="Port" Value="[PORTNUMBER]" />
</Component>

I thought that the upper code would allow me to perform the component's 
tasks only if ENGINECONFISINSTALLED was false (that would be on a first 
install).
What I'm trying to do is condition the whole APM_ENGINE_CONFIG_REF 
component. But I can't : whatever I put as a condition, the component 
tasks are executed (on first install AND on upgrade)
I must be doing something wrong here, but I can't find out what...

Thanks for your help.

Fred

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to