2

Iam using Wix and I have custom actions written in .net targeting Dotnet 4.0. During the installation , after welcome dlg , the dotnet framework is checked in the system and the dotnetframework prerequisite dialog is shown if it is not there. If the dot net framework is installed it will go to the progressdialog where the custom actions written in .net would be called. But on a system where dotnet framework is not installed , the msi is not at all going to welcomedlg itself it is throwing the below error. In the customaction config below entries are there

<startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> <supportedRuntime version="v2.0.50727"/>

it says below error SFXCA: Extracting custom action to temporary directory: C:\DOCUME~1\\LOCALS~1\Temp\MSI34.tmp-\ SFXCA: Failed to get requested CLR info. Error code 0x80131700 SFXCA: Ensure that the proper version of the .NET Framework is installed, or that there is a matching supportedRuntime element in CustomAction.config. If you are binding to .NET 4 or greater add useLegacyV2RuntimeActivationPolicy=true to the element.

user1570697
  • 83
  • 2
  • 11
  • I strongly suggest you accept .NET Framework 4.5 to be installed instead of `.NET Framework 4.0` which CANNOT be installed on Windows 8 for obvious reasons. More of your code and the configuration file it required to help. – Security Hound Feb 25 '13 at 14:36
  • 1
    This looks very similar: http://stackoverflow.com/questions/3298304/wix-custom-actions-built-for-net-framework-4-0-does-not-work-ways-to-resolve – Peter Ritchie Feb 25 '13 at 15:49
  • How are you checking for the dot net framework v4? Are you using the Wix .NET extensions to do this? If you add these to the wxs file and specify the correct condition (see http://wix.sourceforge.net/manual-wix3/check_for_dotnet.htm) then your installer should show a friendly error message prior to showing the first wizard page and exit cleanly. Ive been doing this for the past 3 years in my main installer package and my CA's never get executed because MSIEXEC stops straight away. – Jay Feb 25 '13 at 17:56
  • Thanks Ramhound and Peter for your comments.Solved it by moving the the custom action to be executed after checking the .net framework . Previously it was scheduled before costinitialize in the installUISequence , and this would happen before the .net framework check and welcomedlg and in this case it expects .net framework. – user1570697 Feb 26 '13 at 06:42
  • @user1570697 Please add your solution as an answer and mark it as correct answer to this question. So that it will help others to identify the solution easily – RinoTom Feb 27 '13 at 17:39
  • @ RinoTom - How to mark the comment as answer? – user1570697 Feb 28 '13 at 07:24

1 Answers1

0

From the comments above, the custom action was scheduled before the condition to check that the correct .NET Framework was installed. The fix was to move the custom action later in the UI sequence.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130