NSentinel
Posts: 32
Joined: Mon Oct 27, 2008 10:09 am

Wrong prereq check on .NET 3.5 SP1

I work with Advanced Installer 7.7, and created new installation project with .NET Prereq set to 3.5 SP1. I recheck prerequisite and found AI assume 3.5 SP 1 installed if there are installed 4.0 client or full. Its wrong because .NET 4.0 is side-by-side installation and don't setup previous version.
Attachments
3.5 SP1 Check.png
3.5 SP1 Check.png (21.22 KiB) Viewed 4148 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Wrong prereq check on .NET 3.5 SP1

Hello,

.Net 4.0 is backwards compatibile with .NET 3.5 SP1 which is why 3.5 is considered installed if .net 4.0 is found on the system.
This is described on Microsoft's version compatibility in the .Net framework page, under the "Backward Compatibility and the .NET Framework 4"
section.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
NSentinel
Posts: 32
Joined: Mon Oct 27, 2008 10:09 am

Re: Wrong prereq check on .NET 3.5 SP1

Thank you for reply. I already studied that link and all info about problem deeply. In reality check attached pic:
Unable.png
Unable.png (6.62 KiB) Viewed 4139 times
Here background:
.NET 4 native apps works as intended, 2.0, 3.5, 3.5 Client all failed if there are only .NET 4 installed. You can check it yourself, just grab clean XP Virtual Machine, e.g. IE VHD and setup there .NET 4 only. Any older app will fail.

Primary reason for that: http://msdn.microsoft.com/en-us/library/w4atty68.aspx runtime check <supportedRuntime> element and if not presented give that error. If you specify your usual runtime, i.e.

Code: Select all

<startup><supportedRuntime version="v2.0.50727" sku="Client"/></startup></configuration>
for 3.5 Client
than you got another error message:
Unable2.png
Unable2.png (7.89 KiB) Viewed 4139 times
If you remove sku="Client" you got:
Unable3.png
Unable3.png (8.62 KiB) Viewed 4139 times
Microsoft tells the truth, of cause. If you specify:

Code: Select all

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
or even without sku attribute "old" assemblies will run, but another trouble will come, some assemblies, for example mixed mode assemblies, will not run until you specify useLegacyV2RuntimeActivationPolicy:

Code: Select all

<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
But after all you get: Image on older framework.

Of cause, this can be relatively easy avoid by using configuration files depended on framework installed or better adding several supportedRuntime tags but developer must think about that. Having by default pass thru .NET version check if there are 4.0 installed for 3.5 (or older) assemblies I thought wrong because by default application will fail on target machine if there only .NET 4.0 framework installed and used default config.

The problem not fabricated, I run into this issue with our customers after upgraded AI and make new setup. So I decided to share problem.

By now it can be fixed by manual removing .NET 4 detect registry keys. Maybe better solution to add ".NET 3.5 only" and .NET 3.5+.NET 4 option or anyway to say about that clearly.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Wrong prereq check on .NET 3.5 SP1

Hello,

Thank you for bringing this to our attention. Indeed your case requires the removal of .NET 4.0 detection from the 3.5 prerequisite.
We will take this into consideration.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”