Hi Alex,
I am having exactly the same problem as RW had, trying to check if a file
exists or not in the installation directory. I have tried to use custom
action but failed and my code is something like this:
<Property Id="XMLFILEEXISTS">
      <DirectorySearch Id="CheckXMLFileDir" Path="[INSTALLLOCATION]"
Depth="0">
        <FileSearch Id="My.XML" Name=" My.XML" />
      </DirectorySearch>
    </Property>

    <InstallExecuteSequence>
      <Custom Action='ifFILEEXISTS' After='Installvalidate' />
       XMLFILEEXISTS
      </Custom>
     
    </InstallExecuteSequence>

         <Feature Id="MyXML" Level="1" Title="My XML" Description="Select to
permit installer to backup and replace your XML with a clean version.">
          <ComponentRef Id="MyXMLFiles" />
          <Condition Level='1000'>
            XMLFILEEXISTS
          </Condition>
        </Feature>


Are you able to provide a sample on how to do this?

Many thanks.

Justin


Alexander Shevchuk wrote:
> 
> You need to schedule custom action after InstallValidate to set the value
> of the XMLFILEEXISTS property.
> 
> Alex
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of RW
> Sent: Friday, February 01, 2008 11:23 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Condition based on INSTALLLOCATION
> 
> Hi,
> 
> I'm trying to turn on and off a feature based on whether a file already
> exists in the installation directory.
> 
> To do this, I'm setting a property based on a FileSearch:
> 
>     <Property Id="XMLFILEEXISTS">
>       <DirectorySearch Id="CheckXMLFileDir" Path="[INSTALLLOCATION]"
> Depth="0">
>         <FileSearch Id="My.XML" Name=" My.XML" />
>       </DirectorySearch>
>     </Property>
> 
> Then, in the feature I have a level condition on it:
> 
>         <Feature Id="MyXML" Level="1" Title="My XML" Description="Select
> to
> permit installer to backup and replace your XML with a clean version.">
>           <ComponentRef Id="MyXMLFiles" />
>           <Condition Level='1000'>
>             XMLFILEEXISTS
>           </Condition>
>         </Feature>
> 
> 
> However, this doesn't appear to work.  Looking in the log files, it
> appears
> that XMLFILEEXISTS is evaluated as part of the AppSearch, which happens
> before the INSTALLLOCATION property is even set, therefore I'm not sure
> where it's looking!
> 
> I could be totally wrong of course... but in the log file, the
> INSTALLLOCATION is set much later than any reference to My.XML.
> 
> Any ideas on what the right way to do this is?
> 
> Many thanks
> 
> RW.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> 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
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Condition-based-on-INSTALLLOCATION-tp15233800p15787100.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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