views:

11322

answers:

3

I need to know this since this is a pre-req for .NET 3.5 and if I'm including the .NET bootstrapper, I should also see if Windows Installer 3.1 is needed.

Right now I'm checking for the registry key:

HKEY_ LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB893803v2 (Space added because for some reason it made "LOCAL" italicized without)

Which will check for Windows Installer 3.1 but I suspect it doesn't check for higher versions. (Haven't been able to confirm or deny that)

What registry key should I look at to find this information?

Edit: I need to check this in Inno Setup which is what I'm using as my bootstrapper, and I'm not sure how to check a dll version in there.

A: 

If this is inside the MSI file itself, you can check for the VersionMsi property.

Martin v. Löwis
A: 

If you're not inside MSI, why don't you just check the version of msi.dll?

Paul Betts
+2  A: 

locate the installer msi.dll with this registry path: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer

value: InstallerLocation

then get the version information from that file.

update: the way above is old! new way to detect the version is documented here: http://msdn.microsoft.com/en-us/library/aa368280%28VS.85%29.aspx

Bernd Ott
Be mindful of redirects on 64-bit systems... which msi file you're directed to will depend on whether your app is running 32 or 64 bit mode. That said, however, the 32 and 64 bit versions of the windows installer *should* be the same on any 64-bit system.
Mark
at least on win32 systems this is just the location, msiexec.exe is the file name. Right click -> Properties -> Version
Dan
the way i described, was the official way documented in msdn (in dec.08 -> see http://blogs.msdn.com/windows_installer_team/archive/2005/09/09/458528.aspx).they updated the best practices to:http://msdn.microsoft.com/en-us/library/aa368280%28VS.85%29.aspx
Bernd Ott

related questions