1. Not quite sure how to answer that... MsiQueryProductState is a standard Win32 API call that can be done from C++ or from managed code using P/Invoke.
2. I don't know enough about the WiX bootstrapper to answer, but I assume it can detect ProductCodes and install something if that ProductCode is not installed. Phil W -----Original Message----- From: Helge Kruse [mailto:helge.kr...@gmx.net] Sent: Monday, December 12, 2011 10:29 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] Detect VC++ runtime version on target system Phil, Thanks for reply. Do you refer to this 1. Call the MsiQueryProductState <http://msdn2.microsoft.com/en-gb/library/aa370363.aspx> API 2. Pass in the product code for the package that you want to detect based on the list below 3. Check the return value of this API. If it is anything other than INSTALLSTATE_DEFAULT, the package is not yet installed How do I call this API? Aaron describes this as the procedure in the VS2005 redistributable bootstrapper. - How do I add this to the wixproj file that defines the bootstrapper built with Votive and MSBuild? - How can I ensure in my .MSI that the bootstrapper has been started to install the redistributable if necessary? But this article and the link to the corresponding VS2005 article http://blogs.msdn.com/b/astebner/archive/2007/01/16/mailbag-how-to-detect-the-presence-of-the-vc-8-0-runtime-redistributable-package.aspx show some GUIDs that I found after installing the redistributable version. This could be used to find it in the registry. But I would use a better approach if possible. Regards, Helge Am 12.12.2011 21:53, schrieb Wilson, Phil: > You need something like this, not a registry search. > > http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx > > Phil W > > ________________________________________ > From: Helge Kruse [helge.kr...@gmx.net] > Sent: Sunday, December 11, 2011 11:11 AM > To:wix-users@lists.sourceforge.net > Subject: [WiX-users] Detect VC++ runtime version on target system > > The WiX help recommends to deploy the Visual C++ runtime using merge > modules. I refer to section "How To: Install the Visual C++ > Redistributable with your installer". While this is possible, I don't > want to include the MSM in every MSI I will generate. Instead I prefer > to add this to the bootstrapper with Votive and MSBuild. > > But this would allow installing a C++ program that might will not run, > when the bootstrapper is not used but the MSI is ran directly. Therefore > I would like to check if the required version of the C++ run time is > installed on the target system. This could be done with a > RegistrySearch. But this allows only accessing registry values. I would > like to do something like this: > > <Property Id="VC80_CRT_762"> > <RegistrySearch Id="Vc80_Crt_762" Root="HKLM" > Key="SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Installations\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_e889b656\downlevel_manifest.8.0.50727.4407" > Name="?????" Type"=raw" /> > </Property> > > <Condition Message="This application needs a newer version of the VC++ > run time."> > <![CDATA[Installed OR VC80_CRT_76"]]> > </Condition> > > How can the condition distinguish between "an empty default value" and > "key not in registry"? > How can this test achieved? > What is the best way to check that the required or a newer version of > the VC++ runtime is installed? > > Regards, > Helge > ------------------------------------------------------------------------------ Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users *** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/en/legal/default.aspx. You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail recept...@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates). ------------------------------------------------------------------------------ Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users