Search code examples
wix.net-3.5bootstrapper

In WiX, what's the correct way to enable .NET 3.5?


I'm creating an installer for a Windows desktop app, which has a dependency on another product that requires .NET 3.5

When installing this on Windows 10, .NET 3.5 is included and has to be enabled in Add/Remove Windows Features. I don't think it is valid to install a downloadable version of .NET 3.5 on Windows 10 (correct me if I'm wrong!).

So, is there a way to get WiX to enable the .NET 3.5 "feature" rather than downloading and installing it?


Solution

  • There is a way to install .NET 3.5 on Windows 10 and the latest Windows Server: to update a group policy value that will allow to download .NET 3.5 (blog post).

    ...open the command prompt and type "gpedit". The "Local Computer Policy Editor" opens where we can locate the necessary setting under the "Computer Configuration" > "Administrative Templates" > "System". On the left side, under "Settings", we can find a setting named "Specify settings for optional component installation and component repair" policy list This is what we are going to modify. Let's open it and check "Enabled" and then check the second option – "Download repair content and optional features directly from Windows Update instead of Windows Server Update Services (WSUS)" and click "OK": policy settings Now, if we retry adding the .NET Framework 3.5, we can see that it succeeds...

    I personally then revert this policy setting to its original value, if it was different.