0

I have a problem when publish application using copy and paste directly on user machine I face very bad error message appear when .NET Framework is not installed on user computer.

To run this application, you first must install one of the following versions of the .NET Framework: v4.0.30319 Contact your application publisher for instruction about obtaining the appropriate version of the .NET Framework.

My question is:

When user click on application icon I want to display custom message box tell user to use .NET Framework if not installed on user machine.

Jret
  • 90
  • 1
  • 13
zezo
  • 49
  • 5
  • This is called **prerequisites** – Jim Oct 31 '16 at 16:34
  • Possible duplicate of [How To Check If The .Net Framework Is Installed \[C# / WPF\]](http://stackoverflow.com/questions/4945006/how-to-check-if-the-net-framework-is-installed-c-wpf) – Jim Oct 31 '16 at 16:43
  • @Jim - can you elaborate on that. Are you referring to a general notion, or a technical solution to this problem? – Don Cheadle Oct 31 '16 at 17:06
  • @mmcrae The actual question is: *when user click on application icon i want to display custom message box tell user to use .net frame work if not installed on user machine* so i do refer to the whole topic. – Jim Oct 31 '16 at 17:18

1 Answers1

1

Sounds like you need a wrapper application which, when clicked, will check if the .NET framework exists. If it does, run the app. Otherwise, show the error message.

But now this wrapper applications needs to reliably run on the platform, even if there is no C#/.NET version which you are checking for.

Don Cheadle
  • 5,224
  • 5
  • 39
  • 54
  • 2
    The problem is also discussed here: http://stackoverflow.com/questions/4945006/how-to-check-if-the-net-framework-is-installed-c-wpf http://stackoverflow.com/questions/21850756/what-if-net-framework-is-not-available – Bouke Oct 31 '16 at 16:39
  • May be one of these deployment options will inspire you: https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx – Bouke Oct 31 '16 at 16:45
  • 1
    The check for framework version needs to be outside C# in case there is no suitable Net Framework installed. There are lot of Powershell scripts which do this check, but they are not always portable. This link has a VBS script: http://stackoverflow.com/questions/29147427/detect-net-framework-3-5-or-higher-using-vbs-through-wmi – John D Oct 31 '16 at 16:45