11

I would like to use WiX Bundle to turn on the Windows Feature version of .NET Framework 3.5. I am aware that there is a list of .NET Framework that can be installed. In fact I use this to install 4.6.2 so that is already done. Also, this list does not contain the 3.5 (possibly because there is a feature already for major recent Windows?)

I have to take in to account of users who does not have 3.5 Enabled.

Is it possible to do so?

Thank you

Shintaro Takechi
  • 1,215
  • 1
  • 17
  • 39
  • [How To: Install the .NET Framework Using Burn](http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_dotnet.html) – zett42 Mar 31 '17 at 06:37
  • Thanks zett42. However, like I said, I have successfully installed .NET 4.6.2. So that is not the issue here. I need to install SQL Local DB and I need .NET 3.5 for it. On Windows 8/8.1/10/Server2012 the .NET is already installed. I just need to enable it. – Shintaro Takechi Mar 31 '17 at 17:33
  • 2
    You can't just "activate" .NET 3.5 on Win 8 or newer. It's [no longer part of these OS](https://msdn.microsoft.com/en-us/library/hh506443(v=vs.110).aspx). Just download the [web installer for .NET 3.5 SP1](https://www.microsoft.com/en-us/download/details.aspx?id=22) and change your existing code to launch that redistributable. This will trigger Windows update to download and install .NET 3.5. – zett42 Mar 31 '17 at 17:51
  • @zett42 Are you sure about that? Because the link you've provided shows it being enabled from the "Windows Features" control panel. – Tim Long Aug 20 '19 at 16:30
  • @TimLong AFAIK this just triggers a download and install through Windows Update. – zett42 Aug 20 '19 at 17:15
  • @zett42 That's an assumption though, right? Which makes me nervous. Net35 is definitely a _Windows Feature_ which is why you can enable it via DISM.exe - that fact that it triggers a download when you do it doesn't necessarily mean that it's a good idea to download and install it yourself. I wish there were more clarity around this. As you can probably tell, this is an issue I'm currently wrestling with myself and I'm not really happy with any of the solutions I'm finding. In the end I've bailed out and I use a launch condition to halt the install if the user hasn't enabled it. – Tim Long Aug 21 '19 at 00:05
  • 1
    It also becomes an issue when user is in the environment without internet connection (which does exist as condition). In this case, we also have to request user to use Windows installation DVD in order to trigger the activation of .NET 3.5. I do not understand why Microsoft does not supply the offline redistributable version. All of their so called offline one does not allow offline installation. – Shintaro Takechi Aug 28 '19 at 18:41

3 Answers3

21

I think you have this error wix toolset requires the .net framework 3.5.1 windows feature to be enabled for this error you can "Control Panel\All Control Panel Items\Programs and Features" and click on "turn windows features on or off" and here put tick on .NET framework 3.5

  • 2
    The problem is not that WiX doesn't work, everything's fine on the development computer. The problem is that we need to do exactly what you describe on the end user system as part of the setup we are authoring. – Tim Long Oct 22 '19 at 04:36
0

You could define a custom action using DISM e.g

<CustomAction Id="ActivateNetFx3" Directory="TARGETDIR" 
ExeCommand="DISM /online /enable-feature /featurename:NetFx3" 
Impersonate="no" Execute="deferred" Return="ignore"/>

As far as I know, for "activating" .NET 3.5 windows needs an internet connection because it is downloaded from the internet.

ChristianMurschall
  • 1,621
  • 15
  • 26
  • This propably doesn't show any UI in case of an error, so it's not very user friendly. – zett42 Aug 20 '19 at 17:19
  • @zett42 This is actually the best answer I've seen though. I presume that an error would result in a nonzero return code from DISM, and the installer could fail if it detected that. That's pure assumption though and I haven't tested it. – Tim Long Oct 22 '19 at 04:38
0

I found the PanelSw WiX extension in the WiX mailing list.

According to the mailnig list it also has error handling and you can also check if a reboot is required.

Here is an example syntax for enabling a feature:

<Component Id="dism" Guid="YOUR-GUID-HERE" Directory="INSTALLDIR">
  <panelsw:Dism EnableFeature="feature-name-regex" ErrorHandling="fail" />
</Component>

The XML Namespace is http://schemas.panel-sw.co.il/wix/WixExtension

Gerd K
  • 1,134
  • 9
  • 23
  • However as it is not possible to uninstall a windows feature (which makes sense as we can't know if some other app relies on it) we decided to not include it in the installer. We think an installer should clean up everything it installed - if it can't we don't install it. – Gerd K Apr 13 '21 at 09:56