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

后端 未结 3 1882
我寻月下人不归
我寻月下人不归 2021-01-26 18:51

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 in

相关标签:
3条回答
  • 2021-01-26 19:25

    WiX Samples: Some potentially helpful links in general:

    • WiX Quick Start Suggestions (with sample links).
    • https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer/

    Alternative Tools: Maybe keep in mind that commercial tools have features that are easier to use to get your product out there quickly. WiX is great though.

    • MSI Tools (comparing different MSI tools)
    • On WiX, setup GUI and Commercial tools

    Prerequisites: I would suggest you add a LaunchCondition to the package to abort installation if the .NET framework is not there. You can bundle the .NET framework with your application, but I really do not recommend that: Outdated prerequisites in packages.

    LaunchCondition: The concept of LaunchConditions checks for a certain condition to be true before installation is allowed to continue:

    • Check if prerequisites are installed before installing a windows installer package (please check this link at the very least - if you don't check other links)
    • An earlier answer on LaunchConditions.

    Quick, inline sample:

    <Condition Message="The .NET Framework 2.0 must be installed">
        Installed OR NETFRAMEWORK20
    </Condition>
    

    WiX and .NET Framework: Some built-in measures to detect the .NET framwork.

    • How To: Check for .NET Framework Versions (official WiX documentation)
    • How to check for .net framework 4.7.1 with Wix 3.11
    • How can I detect whether .NET Framework 4.6.1 or higher is installed in WiX?

    Link:

    • Wix IIS Version check launch condition not working
    • LaunchConditions and missing runtimes
    0 讨论(0)
  • 2021-01-26 19:29

    Not sure whether this is the correct way but you can try a custom action with the following command

    dism.exe /online /enable-feature /featurename:NetFx3
    

    You can get a list of all available features by dism /online /get-features if you want to try other windows features.

    0 讨论(0)
  • 2021-01-26 19:44

    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" 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": 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.

    0 讨论(0)
提交回复
热议问题