0

I would like to preempt pop up / error window if the users machine doesn't have required .net framework installed. I was thinking about checking the users registry first with simple "if" statement but will this work? If yes than I would love see some examples.

The second question is about getting the folder which contains my application. Usually it's default location like "downloads" folder or the desktop but what if someone saved it in different place? How to retrieve this location?

  • Please don't ask two different topics in one question, just create a new question. – Dávid Molnár Oct 29 '17 at 12:55
  • For the second question: you can use `AppDomain.CurrentDomain.BaseDirectory`, see https://stackoverflow.com/questions/6041332/best-way-to-get-application-folder-path – Dávid Molnár Oct 29 '17 at 12:56

1 Answers1

1

You can check the registry to determine which .NET version is installed. See this link for details: https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

You can NOT do this check in your application, because if .NET is not installed it won't run at all. You can create a simple native application which checks the registry and shows the error message or starts your .NET application.

Dávid Molnár
  • 10,673
  • 7
  • 30
  • 55