Error w/ Prerequisite Install Condition? - Advanced Installer Community
CarlEMac2008
Posts: 17
Joined: Tue Apr 29, 2008 7:12 pm

Error w/ Prerequisite Install Condition?

Hi All,

My overall goal is to determine if the target system has .NET Framework 2.0 Service Pack 1 or higher installed. If not, I'll run the Service Pack 1 installer.

In doing so, I'm adding a Prerequisite Install Condition (see attached screenshot):

<Search Type><Criteria> = "Registry value with specified content"
<Search Type><Registry Value> = "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version"
<Content><Value> = 2.1
<Content><Comparison> = "Greater Than"

I find that neither "Less Than" or "Greater Than" for <Content><Comparison> give expected results - <Test> button in <Edit Prerequisite> always returns FAILURE (installation fails as well during install-time).

A workaround is to use "Starts With" for <Content><Comparison> but this isn't optimal as Service Pack 2 (if it ever comes out) would break the condition.

TIA
Attachments
pic.jpg
pic.jpg (21.23 KiB) Viewed 4321 times
CarlEMac2008
Posts: 17
Joined: Tue Apr 29, 2008 7:12 pm

Re: Error w/ Prerequisite Install Condition?

More Grist for the Mill:

The install dialog does not give what seems to be a meaningful indication of install state for .NET 2.0.

For example, the attached screenshot shows what the installer thinks the situation is on the target machine ("Required: any. Found: nothing"), whereas the true state is that I have required a specific version (which is not "Required: any") and it should have found the registry-value ("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version") but it does not satisfy the condition (which is not "Found: nothing").

I am confused and so will be the support-tech who has to field the call from my end-user.

TIA
Attachments
pic1.jpg
pic1.jpg (38.6 KiB) Viewed 4321 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Error w/ Prerequisite Install Condition?

Hi,

Please note that the Detecting Patches in .NET 2.0 and Visual Studio 2005 article explains how to detect .NET Framework 2.0 SP1.
I find that neither "Less Than" or "Greater Than" for <Content><Comparison> give expected results
Note that these comparison options work only for integer values (a DWORD or String registry value which can be resolved to an integer value). Since a version cannot be resolved to an integer, the search is always false. An alternative is to use a "Registry Value" detection criteria and set the "Min" version to "2.1".
A workaround is to use "Starts With" for <Content><Comparison> but this isn't optimal as Service Pack 2 (if it ever comes out) would break the condition.
The detection method explained in the above article uses another registry value. This value holds the number of the service pack and it can be used to identify which service pack is installed.
the attached screenshot shows what the installer thinks the situation is on the target machine ("Required: any. Found: nothing"), whereas the true state is that I have required a specific version (which is not "Required: any") and it should have found the registry-value ("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version") but it does not satisfy the condition (which is not "Found: nothing").
Please note that the prerequisite information shown to the user can be specified in the Properties tab of the "Edit Prerequisite" dialog. Therefore, if the "Name", "Ver Min" and "Ver Max" fields are empty, the prerequisite wizard will show "Required: any".

Also, the wizard states "Found: nothing" because the registry value you are using as a detection criteria cannot be resolved to an integer value. If you use a "Registry value" detection criteria instead of "Registry value with specified content", the wizard will show the .NET Framework version found on the machine (if the "Version" value exists).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
CarlEMac2008
Posts: 17
Joined: Tue Apr 29, 2008 7:12 pm

Re: Error w/ Prerequisite Install Condition?

Thanks, Cosmin...I'm now using the "Registry Value" technique as you recommend.

Return to “Common Problems”