PDA

Click to See Complete Forum and Search --> : [RESOLVED] .Net 2 Installed


Foxy69
Apr 1st, 2008, 08:39 AM
I currently have an application written in 2003 running .Net 1.1.

Whenever I issue a new release I load a new EXE onto a FTP server and the clients automatically updates when they next launch the application.

In the near futture I want to convert the app to 2008 and .Net 2. So what I thought was that the next time I issue a new version I could put a check in to see if the client has .Net 2 already installed, and if not launch the dotnetrfx2.exe in preperation.

Does anybody have any sample code that checks for the versions of .Net installed on a client? I've searched through the posts but can't seem to find a difinative answer.

Thanks

Aspnot
Apr 1st, 2008, 08:47 AM
What deployment mechanism are you using? ClickOnce gives you the option to select which .Net Frameworks are pre-requisites. That would take care of the whole thing for you.

danasegarane
Apr 1st, 2008, 08:49 AM
You could to check during the package developement wizard.

See the "To set optional properties for the deployment project" title in this Link

http://msdn2.microsoft.com/en-us/library/xxyh2e6a(VS.80).aspx

danasegarane
Apr 1st, 2008, 08:53 AM
Or You could to retrive the key name in the registry in this path

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework

and check for the particular version is avalible and check vice versa

Pino
Apr 1st, 2008, 09:37 AM
So from a clients machine you are simply downloading an exe and replacing there existing version. Why not put some code into your exe to check the above reg key to see if the framework exists. If not then either fire a download or shell the .Net install file from a network drive.

I suppose that depends if your users have rights to install on the machines.

Foxy69
Apr 1st, 2008, 02:47 PM
I've ended up checking the registry to see if the following key exists

software\microsoft\net framework\ndp\v2.0.50727

If it doesn't it then runs an install of dotnetfx.exe and terminates the program. I was really wondering if there was a class in .Net to see what versions were installed, but the above works fine.

Thanks