Well, I'm also trying that, and I'm just not grok'ing file search. 

<Property Id="SYSCONFIGEXISTS" Secure="yes">
   <DirectorySearch Id="ds_INSTALLDIR" Path="[INSTALLDIR]" Depth="0">
      <FileSearch Id="fs_SysConfig" LongName="SysConfig.xml" />
   </DirectorySearch>
</Property>
<Condition Message="SysConfig.xml exists!
[SYSCONFIGEXISTS]"><![CDATA[SYSCONFIGEXISTS]]></Condition>
<Condition Message="SysConfig.xml does not exist!
[SYSCONFIGEXISTS]"><![CDATA[NOT SYSCONFIGEXISTS]]></Condition>

For some reason, the "SysConfig.xml exists!" message is firing even when
INSTALLDIR does not exist on the system; let alone SysConfig.xml.  

I moved AppSearch after CostFinalize to make sure that INSTALLDIR is
resolved before the AppSearch, but still nothing.

Note that I am using WiX v2 if that matters.


--
Bill Arnette
www.starwitness.com
 

-----Original Message-----
From: Pierson Lee (Volt) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 11:59 AM
To: Arnette, Bill; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] Conditionally edit XML file if it is installed

Would it be worthwhile to do a filesearch and if it doesn't exist to
then install the component and change the file (in a different feature)?

That would be the way I'd do it, but I have yet to use the
NeverOverwrite option.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Arnette,
Bill
Sent: Thursday, July 19, 2007 7:14 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Conditionally edit XML file if it is installed


I am trying to have my installer edit an XML file after it is installed.
However, the XML file should not be installed or edited if it already
exists on the system.  So I am trying to condition the installation of
the XML editing component on the state/action of the component which
contains the XML file to be edited.  But its not working.

I am seeing some conflicting info in the Windows Installer documentation
that in one place states the component state can only be used in the
condition table and the sequence tables, while the Component table
documentation states that the Condition column "accepts conditional
expressions containing references to the installed states of features
and components...".

So which is it?
Any idea what I'm doing wrong?


<Directory Id="INSTALLDIR" Name="FrzFrame" LongName="StarWitness
FreezeFrame">
   <Component Id="c_SysConfig_xml"
    Guid="0AD3B4EF-331D-4018-9694-7C738D13F86F"
    DiskId="1" NeverOverwrite="yes" Permanent="yes">
     <File Id="f_SysConfig_xml" Name="SysConf.xml"
LongName="SysConfig.xml" KeyPath="yes"
      Source="$(var.stageDir)\SysConfig.xml" />
   </Component>

   <Component Id="c_EditSysConfig_xml"
Guid="426C9462-C96C-4abe-8665-89523F9725C6" DiskId="1">
      <!-- Only edit the sysconfig.xml file if it is being installed
-->
      <Condition ><![CDATA[$c_SysConfig_xml=3]]></Condition>

      <XmlFile Id="xml_SetCaseRootDir" File="[#f_SysConfig_xml]"
         ElementPath="//configuration/caseRootDir"
Value="[DATAFILESTOREDIR]"
         Action="setValue" Sequence="1"/>
      <XmlFile Id="xml_SetCaptureDir" File="[#f_SysConfig_xml]"
         ElementPath="//configuration/captureDir"
Value="[MEDIAFILESTOREDIR]"
         Action="setValue" Sequence="2"/>
      <XmlFile Id="xml_SetTempDir" File="[#f_SysConfig_xml]"
         ElementPath="//configuration/tempDir" Value="[TEMPDIR]"
         Action="setValue" Sequence="3"/>
   </Component>
</Directory>



--
Bill Arnette
Principal Software Developer
StarWitness Business Unit
Signalscape, Inc.
www.starwitness.com


------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express Download DB2 Express C -
the FREE version of DB2 express and take control of your XML. No limits.
Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
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