Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSI function to go from features to components

52 views
Skip to first unread message

Vicky

unread,
Nov 14, 2002, 1:00:11 AM11/14/02
to

Hi there,

I know how to enumerate Products given a Component, and how to enumerate
Features given a Product, but I can't seem to find a way to enumerate
through the Components of a Feature.

What I currently have is something like this:

Loop with MsiEnumComponents() to get all components {
MsiGetProductCode() to get product
MsiGetComponentPath() to get filename
Do stuff if it's an executable
}

My problem is that Features that are install-on-demand cause the Windows
Installer browse dialog to pop up, and I'd like to avoid that.

There's MsiQueryFeatureState() to help you avoid advertised features where
you pass in a Product, but there's no way to tell which of that Product's
Components belong to the advertised Feature.

Please, can anyone help?


Vicky


Vicky

unread,
Nov 15, 2002, 1:02:57 AM11/15/02
to

FYI, I solved the problem by using MsiSourceListForceResolution()
(per-user) to force the installer to look up the source silently. It's no
protection against network/installation media becoming unavailable, but at
least it will stop the windows installer dialog from appearing when it's
just an install-on-first use scenario. Much less confusing for users :)

Hope that helps somebody else.


V

Carolyn Napier [MS]

unread,
Nov 20, 2002, 7:42:59 PM11/20/02
to
Just a couple of notes:

A component can be shared among different products so MsiGetProductCode will
not give you all of the information you might want. A better API maybe
MsiEnumClients which will give you all of the products for a particular
component.

The feature component mapping is expressed in the FeatureComponents table of
the installation package. If the local cached package is present (there are
some cases where it may not be), you can query the FeatureComponents table
in the local cached package using SQL queries (ala MsiDatabaseOpenView).
You can retrieve the location of the cached package with the
MsiGetProductInfo API. If you're worried about transforms and/or patches
adding new content via additional features and components, then you should
consider using the MsiOpenPackage API as opposed to the MsiOpenDatabase API.
You can get a database handle from the MsiOpenPackage handle via the
MsiGetActiveDatabase API.

You can also use MsiSetInternalUI to turn off Installer UI. (For example,
MsiOpenPackage creates an engine object, so if you don't want that little
"Preparing to..." dialog to pop up during that API call, then use
MsiSetInternalUI to turn off the UI).

Hope this helps,
- Carolyn Napier [MS]
Microsoft Windows Installer Team

Check out the Windows Installer FAQ at:
<http://www.microsoft.com/windows2000/community/centers/management/msi_faq.a
sp>

Please do not send email directly to the alias used to post to the
newsgroup. The alias is for newsgroup purposes only. This posting is
provided "AS IS" with no warranties, and confers no rights.


"Vicky" <vic...@aurema.com> wrote in message
news:Pine.GSO.4.33.021114...@swag.sw.oz.au...

play...@gmail.com

unread,
May 27, 2014, 5:10:15 AM5/27/14
to
MsiSetInternalUI is amazing!! Thank you so much!!
0 new messages