Wix bootstrapper will not detect installed .NET platform

I have a Wix installer and a boot application to install my application and service. As a prerequisite, I need to install the .NET 2.0 SP2 Framework and try to detect this using the following code:

<Chain> <PackageGroupRef Id='Netfx2Package' /> <MsiPackage SourceFile="..\Wix.CHL7.Dispatcher.Service.AZHF\bin\Debug\Wix.CHL7.Dispatcher.Service.AZHF.msi" Id="Wix.CHL7.Dispatcher.Service.AZHF_PackageId" Cache="yes" Visible="no"> <MsiProperty Name="INSTALLDIR" Value="[INSTALLPATH]" /> <MsiProperty Name="WixAppFolder" Value="[INSTALLSCOPE]"/> </MsiPackage> </Chain> </Bundle> <Fragment> <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx2Package" /> <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" /> <PackageGroup Id="Netfx2Package"> <ExePackage Id="Netfx2Exe" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" SourceFile="C:\Installation\Wix.CHL7.Dispatcher.Service.Bootstrapper\lib\NetFx20SP2_x86.exe" DownloadUrl="http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe" DetectCondition="NETFRAMEWORK20" InstallCondition="FALSE"/> </PackageGroup> </Fragment> 

When I run the installer on a computer with .NET 2.0 SP2 installed (checked it in the registry), my installer wants to download and install the framework.

I assume that my DetectCondition is incorrect, but cannot find the correct solution to my problem. So, how do I determine if .NET 2.0 Service Pack 2 (SP2) is installed in my boot file?

Thanks in advance!

W

+4
source share
1 answer

Make sure you reference NetFxExtension correctly.

Source: WixNetfxExtension

Using WixNetfxExtension Properties To use the WixNetfxExtension properties in MSI, follow these steps:

Add PropertyRef elements for the elements listed above that you want to use in your MSI. Add the command line -ext parameter when calling light.exe to include WixNetfxExtension in the MSI binding process.

For instance:

 <PropertyRef Id="NETFRAMEWORK20" /> 

In addition, you probably want to use the NETFRAMEWORK20_SP_LEVEL property to get the appropriate service pack level if you need Service Pack 2 (SP2). In troubleshooting, I also checked the installation log to see if it indicates property values.

+5
source

All Articles