I have a wxs here that has a Property / DirectorySearch / FileSearch nesting 
where I'm using Directory@Path="[%WINDIR]\assembly" Depth="3" and doing a 
search 
for an assembly name with a specific Min Version.   We used this to detect 
that a product we integrate with has it's .NET interop libraries installed in 
the GAC. ( There were certain scenarios that we wanted to detect and guard 
against. )

This has served us well for the last 5 years but the truth of the matter 
is it's 
a completely flawed design.  It's only matching on the AssemblyName and 
AssemblyFileVersion.  Strong Named Assemblies use AssemblyVersion not 
AssemblyFileVersion and the token is also important.

So if you want to do it "right" what is really needed is a custom action to run 
after AppSearch to implement a GacSearch custom table where you describe the 
assemblies you are looking for and a property is set to 1 or Null depending on 
whether the custom action could use the Fusion API to resolve the assembly.  I 
suppose you could set it to the file path of the assembly instead of 1 but I 
can't think of a good reason to care where exactly in the GAC the file is 
physically stored.

Chris
 
---
Christopher Painter, Author of Deployment Engineering Blog
Have a hot tip, know a secret or read a really good thread that deserves 
attention? E-Mail Me



----- Original Message ----
From: Rob Mensching <r...@robmensching.com>
To: General discussion for Windows Installer XML toolset. 
<wix-users@lists.sourceforge.net>
Sent: Tue, March 29, 2011 7:13:14 AM
Subject: Re: [WiX-users] Problem searching GAC for installed assembly

How about a ComponentSearch instead of a FileSearch?

On Mon, Mar 28, 2011 at 2:11 PM, CoolBreeze <coolbreeze...@googlemail.com>wrote:

> Thanks for the reply Chad. I've tried increasing the Depth to say 4 as well
> as providing and absolute path to the assembly and when I compile, I get
> the
> following error:
>
> Error    1    When the parent DirectorySearch/@Depth attribute is greater
> than 1 for the DirectorySearch 'GACPath', the FileSearch/@Id attribute must
> be absent for FileSearch 'CslaFileSearch' unless the parent
> DirectorySearch/@AssignToProperty attribute value is 'yes'. Remove the
> FileSearch/@Id attribute for 'CslaFileSearch' to resolve this issue.
>
>C:\Source\MS-Intelliscript\ProjectDeployments\ProjectDeployments\eCoPayWebSite.Setup\ConditionChecks.wxi
>i
> 18    1    eCoPayWebSite.Setup
>
> Now I've also tried removing the ID for my FileSearch as the error
> suggests,
> but each time I run the installer it stops with my Condition message not
> matter what I try.
>
> I'm trying to essentially provide a base path of %systemroot%\assembly\ and
> have the installer do a recursive search for the assembly I specify within
> my FileSearch as the assembly could reside in a number of sub-folders like
> you specified. I must be missing something simple, because it doesn't seem
> that it should be so difficult to get this to work.
>
> On Mon, Mar 28, 2011 at 4:38 PM, Chad Petersen
> <chad.peter...@harlandfs.com>wrote:
>
> > If you run a CMD prompt and change to c:\windows\assembly folder and
> > then do a DIR you will likely see GAC, GAC_32 and GAC_MSIL as
> > subfolders. Yours is apparently in GAC_MSIL. From there it has folders
> > following a name similar to your DLL name. Then a <version> specific
> > folder in which your DLL will likely reside. You might try including the
> > additional folders in your search or possibly increasing the Depth= to
> > something more like 3.
> >
> > Path="%systemroot%\assembly\GAC_MSIL\Csla\<version>"
> >
> > -----Original Message-----
> > From: CoolBreeze [mailto:coolbreeze...@googlemail.com]
> > Sent: Monday, March 28, 2011 1:15 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: [WiX-users] Problem searching GAC for installed assembly
> >
> > I'm having some problems with getting a condition I've defined to work
> > properly. I have the following condition defined and I'm trying to have
> > the
> > installer search the GAC for the existence of the assembly. If the
> > assembly
> > isn't present I don't want to proceed with the installation, because
> > it's a
> > pre-requisite that it must already exist.
> >
> > <Property Id="CSLA">
> >    <DirectorySearch Id="GACPath" Path="%systemroot%\assembly\"
> > Depth="0"
> > AssignToProperty="no">
> >      <FileSearch Id="CslaFileSearch" Name="Csla.dll" />
> >    </DirectorySearch>
> > </Property>
> > <Condition Message="CSLA 3.6.2 must be installed before you can continue
> > with the installation.">Installed OR CSLA</Condition>
> >
> > Can anyone see what the problem might be? Each time I start the
> > installer,
> > it comes up saying that CSLA must be installed, even on a machine that
> > does
> > have it installed under C:\Windows\assembly\GAC_MSIL\Csla\...
> > ------------------------------------------------------------------------
> > ------
> > Create and publish websites with WebMatrix
> > Use the most popular FREE web apps or write code yourself;
> > WebMatrix provides all the features you need to develop and publish
> > your website. http://p.sf.net/sfu/ms-webmatrix-sf
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Create and publish websites with WebMatrix
> > Use the most popular FREE web apps or write code yourself;
> > WebMatrix provides all the features you need to develop and publish
> > your website. http://p.sf.net/sfu/ms-webmatrix-sf
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and publish
> your website. http://p.sf.net/sfu/ms-webmatrix-sf
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


-- 
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to