|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Identify .NET Framework versionIs there a way to programmatically identify the .NET Framework version(s)
installed on a client PC? My application requires 1.1 SP1 and I'd like to give a warning to the user if they don't have it. I found this KB, http://support.microsoft.com/?kbid=318785&sd=msdn#XSLTH3153121122120121120120 But it suggests looking at the file versions of Mscorlib.dll, which seems a little clunky. Is there a class that could be queried to find this information? Is there a better way I can make sure the user has 1.1 with SP1 installed? Thanks, Michael What's the context here? Example: If you were just running a setup project
you'd use the built-in framework check for the version you need. But if you were writing a program that checks you'd use the checks in that KB article. -- Show quotePhil Wilson [MVP Windows Installer] ---- "Michael" <Mich***@discussions.microsoft.com> wrote in message news:A9D3692E-3724-4B65-B2DD-9A1340B7E58B@microsoft.com... > Is there a way to programmatically identify the .NET Framework version(s) > installed on a client PC? > My application requires 1.1 SP1 and I'd like to give a warning to the user > if they don't have it. > I found this KB, > http://support.microsoft.com/?kbid=318785&sd=msdn#XSLTH3153121122120121120120 > But it suggests looking at the file versions of Mscorlib.dll, which seems > a > little clunky. > Is there a class that could be queried to find this information? Is there > a > better way I can make sure the user has 1.1 with SP1 installed? > > Thanks, > Michael The context is that I have seen errors occur with my app on a PC that doesn't
have the SP1 for 1.1 installed. Installing the SP fixed the issue. Yes, you are right in that if there is no .NET framework at all, the application will prompt the user to install it. However, I'd like the application to specifically check for 1.1 SP1 Michael Show quote "Phil Wilson" wrote: > What's the context here? Example: If you were just running a setup project > you'd use the built-in framework check for the version you need. But if you > were writing a program that checks you'd use the checks in that KB article. > -- > Phil Wilson [MVP Windows Installer] > ---- > "Michael" <Mich***@discussions.microsoft.com> wrote in message > news:A9D3692E-3724-4B65-B2DD-9A1340B7E58B@microsoft.com... > > Is there a way to programmatically identify the .NET Framework version(s) > > installed on a client PC? > > My application requires 1.1 SP1 and I'd like to give a warning to the user > > if they don't have it. > > I found this KB, > > http://support.microsoft.com/?kbid=318785&sd=msdn#XSLTH3153121122120121120120 > > But it suggests looking at the file versions of Mscorlib.dll, which seems > > a > > little clunky. > > Is there a class that could be queried to find this information? Is there > > a > > better way I can make sure the user has 1.1 with SP1 installed? > > > > Thanks, > > Michael > > > Greetings Michael,
If you are attempting to perform this check at runtime, then the following registry key indicates the service pack level for .NET 1.1: Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322\ SubKey Name: SP SubKey Value: 0 or 1 You can read this value using classes in the Microsoft.Win32 namespace, see the following article for examples of how to do this: http://msdn2.microsoft.com/en-US/library/8bf3xkta(VS.80).aspx However, note that the user may require special privileges on their local machine to perform this lookup. As an alternative, performing this check as part of an installation package may be a better solution, as the package will normally be executed by a user/account with administratative privileges. Cheers, Matt just read the registry key HKLM software policy (memory doesn't serve me
right) but that's close enough -- Show quoteRegards, Alvin Bruney [MVP ASP.NET] [Shameless Author plug] The Microsoft Office Web Components Black Book with .NET Now Available @ www.lulu.com/owc Forth-coming VSTO.NET - Wrox/Wiley 2006 ------------------------------------------------------- "Michael" <Mich***@discussions.microsoft.com> wrote in message news:A9D3692E-3724-4B65-B2DD-9A1340B7E58B@microsoft.com... > Is there a way to programmatically identify the .NET Framework version(s) > installed on a client PC? > My application requires 1.1 SP1 and I'd like to give a warning to the user > if they don't have it. > I found this KB, > http://support.microsoft.com/?kbid=318785&sd=msdn#XSLTH3153121122120121120120 > But it suggests looking at the file versions of Mscorlib.dll, which seems > a > little clunky. > Is there a class that could be queried to find this information? Is there > a > better way I can make sure the user has 1.1 with SP1 installed? > > Thanks, > Michael |
|||||||||||||||||||||||