Turning Windows Features on with WiX Installer
Asked Answered
P

3

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

Purpure answered 30/3, 2017 at 16:54 Comment(7)
How To: Install the .NET Framework Using BurnJamin
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.Purpure
You can't just "activate" .NET 3.5 on Win 8 or newer. It's no longer part of these OS. Just download the web installer for .NET 3.5 SP1 and change your existing code to launch that redistributable. This will trigger Windows update to download and install .NET 3.5.Jamin
@Jamin Are you sure about that? Because the link you've provided shows it being enabled from the "Windows Features" control panel.Panicle
@TimLong AFAIK this just triggers a download and install through Windows Update.Jamin
@Jamin 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.Panicle
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.Purpure
S
24

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

Saccharose answered 6/9, 2019 at 10:50 Comment(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.Panicle
was able to install WIX v3.11 in windows 10 with this answerSelfloading
K
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.

Kossuth answered 21/4, 2017 at 12:3 Comment(2)
This propably doesn't show any UI in case of an error, so it's not very user friendly.Jamin
@Jamin 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.Panicle
A
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

Auer answered 13/4, 2021 at 9:52 Comment(1)
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.Auer

© 2022 - 2024 — McMap. All rights reserved.