Some kind of warning about not having dot net framework for user

aewarnick

Well-known member
Joined
Jan 29, 2003
Messages
1,031
Does MS or anyone make a warning you can put in your program if someone does not have the framework and how to get it? All that showes now is about some dll missing.

Or, is it possible to make my own error message about that?
 
Taken from MSDN:

"Installers created using Visual Studio .NET deployment tools include a default launch condition (MsiNetAssemblySupport) that checks for the .NET Framework on the target computer. If it is not found, installation is halted and a dialog box displays the following default message to the user: "This setup requires the .NET Framework. Please install the .NET Framework and run this setup again." You should replace this message with a message that is customized for your applications users.

For example, if your application is being distributed by CD-ROM, your message might read: "This setup requires the .NET Framework. Please install the .NET Framework by running the file Dotnetfx.exe, which can be found in the NetInstall directory on this CD, and then run this setup again."
 
Not sure if this helps, but to get the version of .NET Framework you can do something like this:

Code:
Private Sub btnCheckVersion_Click(...) Handles btnTest.Click
      GetInfo()
  End Sub

Sub GetInfo()
   Sub GetInfo()
    Dim Major As String = CStr(System.Environment.Version.Major)
    Dim Minor As String = CStr(System.Environment.Version.Minor)
    Dim Build As String = CStr(System.Environment.Version.Build)

    lblVersion.Text = Major & "." & Minor & "." & Build
  End Sub
  End Sub
 
That is helpful for some things but what I wanted was a message that will pop up for a user that does not have the framework at all installed when they click on my program displaying a link label of where to get it.
 
This worked very well indeed

Not very much in the way of instructions but from what I gather
it bootstraps the file.msi and the dotnetfx.exe and installs both as needed.

Would like to have some control over the setup.exe like icons and message texts but other than that recomended
 
What I would really like to do is put unmanaged code in the beginning of my program. Is this posible and does anyone have a site to direct me to that will teach me how?
 
Do you mean run from the installer, or actually in the program youre installing?
 
Code within my code that is unmanaged. I do not want to use installers yet at all.

There is alot of docs on the internet about calling unmanaged dlls from your code but I did not see any that included how to start your program off with unmanaged code. And I dont mean using an unmanaged program to search for the framework and then, if it is found starting the managed program.

Though that would work I just think there may be a better way.

At the beginning of my program there would need to be unmanaged code to search for the framework, if it is found, the program will use the framework and move on like normal. If it is not found the unmanaged code will display a message with an internet link to the framework.
 
Last edited by a moderator:
I dont think youll have much luck doing that from C#. Maybe managed C++, but you cant mix and match code like that from a C# application.
 
Back
Top