brian
Posts: 39
Joined: Tue Nov 29, 2005 5:30 pm
Location: California, USA

Detect .Net Framwork in Prerequisite

Here's how to detect what version of .Net is installed:
http://support.microsoft.com/default.as ... LN];315291

I'm not sure how AI does this in a prerequisite is correct? The one that's pre-defined by Advanced Installer searches for the file mscoree.dll, and checks the version. But this isn't the correct way to go. When I was testing my installer I tried it on a computer that had .net 2.0 on it and i uninstalled it. mscoree.dll stayed at version 2.0 and AI didn't install it.

Is there a way to search for different registry keys instead?

Brian
brian
Posts: 39
Joined: Tue Nov 29, 2005 5:30 pm
Location: California, USA

OK, I think I figured out a way to do this.

First, I set a Registry Value Criteria on a new Prerequisite. I made the value "HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v2.0\50727", set the Minimum version to 50727 and left the maximum version blank. This seems to have done the trick and the setup.exe now installs the product.

For the case of a user double clicking on the msi, I added an HKLM registry Search named DOTNET2 with a key of "SOFTWARE\Microsoft\.NETFramework\policy\v2.0" and the Name "50727", Type "Retrieve the raw value". Then, add a launch condition of DOTNET2<<"50727". This launch condition warns the user that .Net 2.0 Framework is required, so I made the description "Microsoft .Net 2.0 Framework is required. Please start the installation program using setup.exe to install .Net 2.0."

This did the trick! Hope this helps someone out.
teknohippy
Posts: 7
Joined: Mon Jan 23, 2006 5:35 pm

Brian you are an absolute star, thank you. I've got this working for my installer and .Net 1.1.

The mscoree.dll thing was being ignored for me as well. Not sure why as I didn't even have an mscoree.dll!

With 1.1 I had to set the minimum version to "3706-4322" and the launch condition I changed to

DOTNET11 == "3706-4322"

as my app MUST have 1.1 to work.#

Thanks again Brian for working most of this out before. Cheers.

Iain

Return to “Common Problems”