Something to note is that in the first call to MsiLocateComponentW, the second param (path buffer) must be NULL, and the third param (buffer size) must be zero, or you will get INSTALLSTATE_INVALIDARGS. (And when you allocate a larger buffer, prior to the first call, it returns INSTALLSTATE_UNKNOWN.) But what I found curious was that when you make the first call with a NULL pointer and zero size indicator, it returns INSTALLSTATE_LOCAL (rather than INSTALLSTATE_MOREDATA, as documented). It also returns the size of the needed buffer, without the terminator in cch. Others have pointed out in MSDN posts that they used to get INSTALLSTATE_MOREDATA but a 'change' happened and they are now observing INSTALLSTATE_LOCAL (returned by the initial call).
Initially I added a switch (installState) {....} of all possible return codes, and then removed it to simplify the post. You will probably want to add code to check the returns, being aware of the above behavior, which seems to differ from the documentation. -- View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Trying-to-use-MsiLocatecomponent-in-Bootstrapper-to-check-for-a-Word-PIA-tp7594186p7594274.html Sent from the wix-devs mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform _______________________________________________ WiX-devs mailing list WiX-devs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-devs