I am writing a custom installer in C#.
Can you tell me an easy way to check if the machine has .NET version installed [even 2.0].
In cases where it is not installed, my app doesn't even start.
Thanks
MSDN has a blog post with sample code to detect if .NET 3 is installed.
[Edit: As mentioned by Stephen Clearly , the author of the blog post also released a tool that can be easily wrapped in a custom installer (and supports all .NET versions) ]
Otherwise:
You could always use the file system and check in the %systemroot%\\Microsoft.NET\\Framework folder.
This will tell you if the following release versions of .NET are installed
我不知道您的自定义安装程序是什么,但您可以在 Visual Studio 中使用安装和部署项目,您可以在其中定义.NET Framework 启动条件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.