How to detect .net Framework 3.5 is installed or available
-
It is known that some functions are supported by .net Framework 3.5. therefore, how to detect automatically that .net framework 3.5 is already installed on the current computer? in order to give the message to the user when the user try to use some functions only supported by .net framework 3.5? thanks.
-
It is known that some functions are supported by .net Framework 3.5. therefore, how to detect automatically that .net framework 3.5 is already installed on the current computer? in order to give the message to the user when the user try to use some functions only supported by .net framework 3.5? thanks.
That doesn't give the user a good experience. I'd hate to have an application tell me "You can't use feature x because you don't have MyWizzyFramework 3.91 installed." Put the .NET Framework as a required resource in your setup project so that it is installed up front (if they don't already have it installed).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
That doesn't give the user a good experience. I'd hate to have an application tell me "You can't use feature x because you don't have MyWizzyFramework 3.91 installed." Put the .NET Framework as a required resource in your setup project so that it is installed up front (if they don't already have it installed).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
thanks, you are right, I agree with you completely. but I provide two choices to the user with similar functions, but the better one is only supported by .net Framework 3.5. I just want my application more flexible to the user, he can select which function he want to use.
-
It is known that some functions are supported by .net Framework 3.5. therefore, how to detect automatically that .net framework 3.5 is already installed on the current computer? in order to give the message to the user when the user try to use some functions only supported by .net framework 3.5? thanks.
The following code will give you the list of available versions. const string regLocation = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP"; RegistryKey masterKey = Registry.LocalMachine.OpenSubKey(regLocation); RegistryKey tempKey; string[] SubKeyNames = masterKey.GetSubKeyNames(); for( int i = 0 ; i < SubKeyNames.Length ; i++ ) {tempKey = Registry.LocalMachine.OpenSubKey(regLocation + "\\" + SubKeyNames[ i ]); MessageBox.Show(SubKeyNames[ i ]); MessageBox.Show("\tVersion = {0}", tempKey.GetValue("Version").ToString()); } Or you can check the currently user version using the following. MessageBox.Show(Environment.Version.ToString());
-
The following code will give you the list of available versions. const string regLocation = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP"; RegistryKey masterKey = Registry.LocalMachine.OpenSubKey(regLocation); RegistryKey tempKey; string[] SubKeyNames = masterKey.GetSubKeyNames(); for( int i = 0 ; i < SubKeyNames.Length ; i++ ) {tempKey = Registry.LocalMachine.OpenSubKey(regLocation + "\\" + SubKeyNames[ i ]); MessageBox.Show(SubKeyNames[ i ]); MessageBox.Show("\tVersion = {0}", tempKey.GetValue("Version").ToString()); } Or you can check the currently user version using the following. MessageBox.Show(Environment.Version.ToString());