4

How can I check for .net framework 4.5.2 in registry using wix. I've tried this

<Property Id="WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED"/>
<Condition
  Message="This application requires .NET Framework 4.5.2. Please install the .NET Framework then run this installer again.">
  <![CDATA[Installed OR WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED]]>
</Condition

but it is not working. I am using wix v3.10

Sony
  • 7,136
  • 5
  • 45
  • 68

2 Answers2

7

Finally after trial and error I managed to solved the issue using

<Condition
  Message="This application requires .NET Framework 4.5.2. Please install the .NET Framework then run this installer again.">
  <![CDATA[Installed OR NETFRAMEWORK45>="#379893"]]>
</Condition>

The condition returns a DWORD which will be prefixed with a # sign and the condition should be

<![CDATA[Installed OR NETFRAMEWORK45>="#379893"]]>

The value 379893 is the Value of the release DWORD. More information can be found from this Microsoft site

EDIT: fixed typo.

invalidusername
  • 912
  • 9
  • 26
Sony
  • 7,136
  • 5
  • 45
  • 68
  • 1
    Found the cause, LaunchConditions action in our kits was scheduled too early - before SetWIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED – MarcusUA Mar 01 '16 at 11:44
0

Try to add a PropertyRef element that has an ID of WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED

<PropertyRef Id='WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED' />