Hi Eric,

Directory resolution is done during CostFinalize, way after AppSearch. What
you need to do is save the value of HostDir in the registry as part of your
install. Then, during reinstall/upgrade you can use AppSearch to get saved
value from registry and use it for FileSearch.

Alex



-----Original Message-----
From: Eric Napier [mailto:napi...@gmail.com] 
Sent: Wednesday, July 22, 2009 8:00 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] filesearch not finding file

Yes, HostDir is the innermost item in my installation hierarchy. It contains
a component and an ini entry (in msi.ini).
So if a different msi with this same structure is executed, I'd expect the
filesearch to find this file. But it's not.
---------- Forwarded message ----------
From: John Ludlow <john.ludlow...@gmail.com>
To: "General discussion for Windows Installer XML toolset." <
wix-users@lists.sourceforge.net>
Date: Wed, 22 Jul 2009 21:59:59 +0100
Subject: Re: [WiX-users] filesearch not finding file
What sets HostDir?  Does HostDir point to a folder containing msi.ini
(you can check that from the log)?

2009/7/22 Eric Napier <napi...@gmail.com>:
> Component search is a better choice except that I won't know the old
> component guid.
> So instead I'm checking for the presence of this file. If it's there, I
want
> to fail the install.
>
> ---------- Forwarded message ----------
> From: "Wilson, Phil" <phil.wil...@wonderware.com>
> To: General discussion for Windows Installer XML toolset. <
> wix-users@lists.sourceforge.net>
> Date: Wed, 22 Jul 2009 11:09:47 -0700
> Subject: Re: [WiX-users] filesearch not finding file
> What's the goal here? Are you looking for that file, or is it just a
marker
> for a previous version of the product? If it was previously installed with
> an MSI package a component search would be more reliable - it doesn't
depend
> on directory locations, and it works if the user changes the install
folder
> from the default Program Files location.
>
> Phil Wilson
>
>
> -----Original Message-----
> From: Eric Napier [mailto:napi...@gmail.com]
> Sent: Wednesday, July 22, 2009 8:29 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] filesearch not finding file
>
> I want to fail an installation if a file (msi.ini) is present. My
filesearch
> element doesn't seem to be finding my file. I've confirmed the file is
> there.
> If I remove the filesearch element, the directory search finds the
directory
> and fails the install. However, when I include the filesearch element it
> never finds my file.
> Can you see my mistake?
>
> My code below.Thanks.
>
>   <Property Id="PREVIOUSMSIINSTALLED">
>     <DirectorySearch Id="MsiIniSearchDir" Path="[HostDir]">
>       <FileSearch Id ="MsiIniSearch" Name="msi.ini"/>
>     </DirectorySearch>
>   </Property>
>   <!-- Do not proceed if an MSI ini was found, unless this is an
> uninstallation.-->
>   <Condition Message="Please remove the previous rep console MSI before
> installing.">(REMOVE ~= "ALL") OR (NOT PREVIOUSMSIINSTALLED)</Condition>
----------------------------------------------------------------------------
--
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to