Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show "An app on your PC needs the following Windows feature." dialog programmatically?

When I try to run .NET 3.5 applications on Windows 8.1 which has not .NET 3.5 Framework, Windows will show the "An app on your PC needs the following Windows feature. .NET Framework 3.5 (includes .NET 2.0 and .NET 3.0)" dialog automatically.

But I want to show this dialog programmatically. I think that the dialog is much more friendly than DISM command.

Any help would be appreciated.

like image 336
LZh Avatar asked Oct 21 '25 15:10

LZh


2 Answers

The dialogue you are searching for is provided by a tool called Fondue (Features on Demand User Experience Tool). To request .NET 3.5 you need to invoke it like this:

FONDUE.exe /enable-feature:NetFx3

Available features can be listed using DISM:

DISM.exe /Online /Get-Features

You can find additional details on Fondue invocation using FONDUE.exe /? or on Microsoft Docs.

like image 192
J5lx Avatar answered Oct 23 '25 05:10

J5lx


  1. Search the registry for .NET 3.5 using Microsoft's suggested code.
  2. Create a Windows Form program and show a MessageBox if the PC does not have .NET 3.5. example code

This is predicated on the PC having a .NET Framework installed. You can't check if the .NET Framework is installed using C#.

like image 39
Emmett Lin Avatar answered Oct 23 '25 05:10

Emmett Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!