Discussion:
[WiX-users] component search ?
Baker, Steve
2005-09-21 17:23:44 UTC
Permalink
In VSDetect.wxs (from the votive setup directory) I see this:



<Property Id="DEVENV_2003_COMP">

<ComponentSearch Id="SearchForDevEnv2003Component"
Guid="153B059B-B2F4-4B54-9AC3-32BE38E470E1" Type="file" />

</Property>



I would like to set the default install directory to where ever the user
installed previously, so I tried this:



<Property Id="PREVIOUS_LOCATION">

<ComponentSearch Id="findPrevious"
Guid="A68697CE-14C4-4635-B239-116D0FBEA3C1" Type="directory" />

</Property>



I don't really understand what ComponentSearch would set
PREVIOUS_LOCATION to if it finds the component? When I test the install
it doesn't set it to anything and I know the component is installed :-(



Do I need to include a DirectorySearch child element or something? I
just want to get at the keypath of the component so I can set a variable
to it.



Thanks,



steve
Bob Arnson
2005-09-21 18:29:11 UTC
Permalink
Short answer: I don't think MSI supports what you want, though I agree it
would be nice. ComponentSearch elements turn into CompLocator table rows.
CompLocator doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/c
omplocator_table.asp says that Type is:

A Boolean value that determines if the key path of the component is a file
name or a directory location.

I read that as saying that you need to specify what the component is, not as
a request for the type of information returned. IOW, if the component's key
path is a file, you need to specify @Type="file" and if the key path is a
directory, you need to specify @Type="directory."

My guess is that your component has a file key path, so it returns nothing
when you ask for its directory key path.

That means you could fix it for the future by providing a component with a
directory key path that you use just for ComponentSearches.

_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Baker, Steve
Sent: Wednesday, 21 September, 2005 10:24
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] component search ?



In VSDetect.wxs (from the votive setup directory) I see this:



<Property Id="DEVENV_2003_COMP">

<ComponentSearch Id="SearchForDevEnv2003Component"
Guid="153B059B-B2F4-4B54-9AC3-32BE38E470E1" Type="file" />

</Property>



I would like to set the default install directory to where ever the user
installed previously, so I tried this:



<Property Id="PREVIOUS_LOCATION">

<ComponentSearch Id="findPrevious"
Guid="A68697CE-14C4-4635-B239-116D0FBEA3C1" Type="directory" />

</Property>



I don't really understand what ComponentSearch would set PREVIOUS_LOCATION
to if it finds the component? When I test the install it doesn't set it to
anything and I know the component is installed :-(



Do I need to include a DirectorySearch child element or something? I just
want to get at the keypath of the component so I can set a variable to it.



Thanks,



steve
Stefan Krueger
2005-09-21 18:53:01 UTC
Permalink
I think you can base a DrLocator search on the result of a CompLocator
search (using the Parent column in DrLocator).
This article should also help:
Searching for a File and Creating a Property Holding the File's Path
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/s
earching_for_a_file_and_creating_a_property_holding_the_file_s_path.asp


Kind regards,
Stefan Krueger
Microsoft Windows Installer MVP

Windows Installer FAQ
<http://www.msifaq.com/> http://www.msifaq.com - <http://www.msifaq.de/>
http://www.msifaq.de

InstallSite - Resources for Setup Developers
<http://www.installsite.org/> http://www.installsite.org
<http://www.installsite.de/> http://www.installsite.de (GERMAN)


_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Bob Arnson
Sent: Wednesday, September 21, 2005 8:29 PM
To: 'Baker, Steve'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?


Short answer: I don't think MSI supports what you want, though I agree it
would be nice. ComponentSearch elements turn into CompLocator table rows.
CompLocator doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/c
omplocator_table.asp says that Type is:

A Boolean value that determines if the key path of the component is a file
name or a directory location.

I read that as saying that you need to specify what the component is, not as
a request for the type of information returned. IOW, if the component's key
path is a file, you need to specify @Type="file" and if the key path is a
directory, you need to specify @Type="directory."

My guess is that your component has a file key path, so it returns nothing
when you ask for its directory key path.

That means you could fix it for the future by providing a component with a
directory key path that you use just for ComponentSearches.
Bob Arnson
2005-09-21 19:14:47 UTC
Permalink
D'oh! Yes, a nested DirectorySearch should do the trick.


_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Stefan Krueger
Sent: Wednesday, 21 September, 2005 11:53
To: 'Bob Arnson'; 'Baker, Steve'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?


I think you can base a DrLocator search on the result of a CompLocator
search (using the Parent column in DrLocator).
This article should also help:
Searching for a File and Creating a Property Holding the File's Path
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/s
earching_for_a_file_and_creating_a_property_holding_the_file_s_path.asp


Kind regards,
Stefan Krueger
Microsoft Windows Installer MVP

Windows Installer FAQ
<http://www.msifaq.com/> http://www.msifaq.com - <http://www.msifaq.de/>
http://www.msifaq.de

InstallSite - Resources for Setup Developers
<http://www.installsite.org/> http://www.installsite.org
<http://www.installsite.de/> http://www.installsite.de (GERMAN)


_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Bob Arnson
Sent: Wednesday, September 21, 2005 8:29 PM
To: 'Baker, Steve'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?


Short answer: I don't think MSI supports what you want, though I agree it
would be nice. ComponentSearch elements turn into CompLocator table rows.
CompLocator doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/c
omplocator_table.asp says that Type is:

A Boolean value that determines if the key path of the component is a file
name or a directory location.


I read that as saying that you need to specify what the component is, not as
a request for the type of information returned. IOW, if the component's key
path is a file, you need to specify @Type="file" and if the key path is a
directory, you need to specify @Type="directory."

My guess is that your component has a file key path, so it returns nothing
when you ask for its directory key path.

That means you could fix it for the future by providing a component with a
directory key path that you use just for ComponentSearches.
Baker, Steve
2005-09-21 19:17:03 UTC
Permalink
Are you thinking the nested directory search maps to the correct msi
schema in the link you provided?



Off to give it a try ;)



thanks



_____

From: Bob Arnson [mailto:***@bobs.org]
Sent: Wednesday, September 21, 2005 2:15 PM
To: 'Stefan Krueger'; Baker, Steve; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?



D'oh! Yes, a nested DirectorySearch should do the trick.




_____


From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Stefan
Krueger
Sent: Wednesday, 21 September, 2005 11:53
To: 'Bob Arnson'; 'Baker, Steve';
wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?

I think you can base a DrLocator search on the result of a
CompLocator search (using the Parent column in DrLocator).

This article should also help:

Searching for a File and Creating a Property Holding the File's
Path


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/set
up/searching_for_a_file_and_creating_a_property_holding_the_file_s_path.
asp




Kind regards,
Stefan Krueger
Microsoft Windows Installer MVP

Windows Installer FAQ
http://www.msifaq.com <http://www.msifaq.com/> -
http://www.msifaq.de <http://www.msifaq.de/>

InstallSite - Resources for Setup Developers
http://www.installsite.org <http://www.installsite.org/>
http://www.installsite.de <http://www.installsite.de/> (GERMAN)






_____


From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Bob Arnson
Sent: Wednesday, September 21, 2005 8:29 PM
To: 'Baker, Steve'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?

Short answer: I don't think MSI supports what you want, though I
agree it would be nice. ComponentSearch elements turn into CompLocator
table rows. CompLocator doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/set
up/complocator_table.asp says that Type is:



A Boolean value that determines if the key path of the
component is a file name or a directory location.



I read that as saying that you need to specify what the
component is, not as a request for the type of information returned.
IOW, if the component's key path is a file, you need to specify
@Type="file" and if the key path is a directory, you need to specify
@Type="directory."



My guess is that your component has a file key path, so it
returns nothing when you ask for its directory key path.



That means you could fix it for the future by providing a
component with a directory key path that you use just for
ComponentSearches.
Baker, Steve
2005-09-21 20:14:01 UTC
Permalink
I have had no luck mapping the necessary wix xml to msi schema for this
:-(



Thanks for the help though, you have me looking in the right direction
;)

_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Baker, Steve
Sent: Wednesday, September 21, 2005 2:17 PM
To: Bob Arnson; Stefan Krueger; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?



Are you thinking the nested directory search maps to the correct msi
schema in the link you provided?



Off to give it a try ;)



thanks



_____

From: Bob Arnson [mailto:***@bobs.org]
Sent: Wednesday, September 21, 2005 2:15 PM
To: 'Stefan Krueger'; Baker, Steve; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?



D'oh! Yes, a nested DirectorySearch should do the trick.




_____


From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Stefan
Krueger
Sent: Wednesday, 21 September, 2005 11:53
To: 'Bob Arnson'; 'Baker, Steve';
wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?

I think you can base a DrLocator search on the result of a
CompLocator search (using the Parent column in DrLocator).

This article should also help:

Searching for a File and Creating a Property Holding the File's
Path


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/set
up/searching_for_a_file_and_creating_a_property_holding_the_file_s_path.
asp




Kind regards,
Stefan Krueger
Microsoft Windows Installer MVP

Windows Installer FAQ
http://www.msifaq.com <http://www.msifaq.com/> -
http://www.msifaq.de <http://www.msifaq.de/>

InstallSite - Resources for Setup Developers
http://www.installsite.org <http://www.installsite.org/>
http://www.installsite.de <http://www.installsite.de/> (GERMAN)






_____


From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Bob Arnson
Sent: Wednesday, September 21, 2005 8:29 PM
To: 'Baker, Steve'; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?

Short answer: I don't think MSI supports what you want, though I
agree it would be nice. ComponentSearch elements turn into CompLocator
table rows. CompLocator doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/set
up/complocator_table.asp says that Type is:



A Boolean value that determines if the key path of the
component is a file name or a directory location.



I read that as saying that you need to specify what the
component is, not as a request for the type of information returned.
IOW, if the component's key path is a file, you need to specify
@Type="file" and if the key path is a directory, you need to specify
@Type="directory."



My guess is that your component has a file key path, so it
returns nothing when you ask for its directory key path.



That means you could fix it for the future by providing a
component with a directory key path that you use just for
ComponentSearches.
Bob Arnson
2005-09-23 02:53:04 UTC
Permalink
Here's one:

<Property Id="HXDS20_FOUND">
<ComponentSearch Id="SearchForHxdsDll_____X86"
Guid="0C4A54FF-5A73-11D3-A520-00A0C9231BA1" Type="file">
<DirectorySearch Id="dirsearch1" />
</ComponentSearch>
</Property>




_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Baker, Steve
Sent: Wednesday, 21 September, 2005 13:14
To: Bob Arnson; Stefan Krueger; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] component search ?



I have had no luck mapping the necessary wix xml to msi schema for this :-(



Thanks for the help though, you have me looking in the right direction ;)
Loading...