Install .NET Framework 4.7.2 (if needed) with WIX installer

Dave picture Dave · Dec 5, 2018 · Viewed 10.1k times · Source

Help! I've inherited a .NET project with a WIX installer project. They make the implicit assumption that .NET Framework 4.5 is installed on each machine which for the most part is true. Now we are adding some features that require .NET Framework 4.7.2 . I'd like to modify the install set to check for the presence of 4.7.2 (or higher) and install via web if necessary. I've found some documentation that's partially answered my questions but I'm still very confused how to get started and how to fill in the specifics. Are there any complete demos or instructions available? My understanding is that I need to add a "BootStrapper" project. I'm confused if I then add/reference the BootStrapper project from my main install (my existing install) OR if I reference the main install as part of the Bootstrapper project (via MsiPackage element). Also, how do I set things up to check for 4.7.2? All the references I found were for 4.5 or earlier and apparently the place in the registry for checking has changed:

How do I detect what .NET Framework versions and service packs are installed?

Assuming I refer to my main install in the Bootstrapper, how do I do this?

These are the links I've found for those interested. They all hint at the answers, but don't give complete answers and/or are out of date.

http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_dotnet.html

https://www.firegiant.com/wix/tutorial/net-and-net/bootstrapping/

https://wix.ronifuchs.com/

Finally, I believe I am using WIX Toolset v3.11. This is what the folder indicates (C:\Program Files (x86)\WiX Toolset v3.11)

I mention this because some of the reference material refers to Wix 4.0 (Example: http://wixtoolset.org/releases/" />)

Thanks!

Answer

Jan Zeman picture Jan Zeman · Feb 20, 2019

I found it bit misleading that the question is about 4.7.2 but the accepted answer about 4.7.1 version.

All the exact bits are here.

Just tested on a computer without 4.7.2 installed and all worked perfectly - the installer downloaded and installed .NET Framework component and first then it continued with the program installation itself.