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

天大地大妈咪最大 提交于 2019-12-04 14:53:54

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 TechNet.

  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#.

It's impossible. But here I have 2 solutions.

  1. You can make a starter in C# or other programming laguage used to check the registry key of .NET Framework to determine which version has the user installed, or no .NET Framework installed.

  2. Using InnoSetup. InnoSetup allows you to write some scripts to check dependency on the user's computer. You should package your application to a setup application. Therefore, your application is no longer a portable software.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!