.net and visual studio newbie question - how to detect if .net is installed and install it if its no

V

Vlad

Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Thanks
Vlad
 
M

Mr. Arnold

Vlad said:
Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers
on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Your friend is Google.

http://www.google.com/search?hl=en&q=how+to+detect+if+.Net+Framework+is+installed&btnG=Google+Search
 
P

Petar Atanasov

Vlad said:
Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Thanks
Vlad

Hi, Vlad

I got the same issue on a project that worked on.
It occurred that one is unable to detect .NET framework from within...

So, check the registry with what you feel comfortable [VbSrcipt, Classic
VB, manually ;), etc] for the following [covering versions from 1.0 to 2.0]:
http://support.microsoft.com/?scid=kb;en-us;315291

I made an small installer app with VB6 and thus overcome the situation...

Could be interesting for me if anyone has made another approach.

Regards,
Petar Atanasov
http://a-wake.net
 
V

Vlad

Thanks Peter.

I was in the middle of doing exactly that when I though "this is such a
hack... there's got to be a better way".
I found another way that *might* work. I can create a setup package for the
app and have the users run it instead - it installs .NET if its not already
there and solves a couple of other issues (security signing etc). However it
asks a user a bunch of questions... I would really like to bypass that and
have that install unattended - just run if .NET is there and install it
quietly and then run if it's not. Any ideas on how to make that happen and
take all those annoying dialogs away during install (including EULA)?

Thanks
Vlad

Petar Atanasov said:
Vlad said:
Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Thanks
Vlad

Hi, Vlad

I got the same issue on a project that worked on.
It occurred that one is unable to detect .NET framework from within...

So, check the registry with what you feel comfortable [VbSrcipt, Classic
VB, manually ;), etc] for the following [covering versions from 1.0 to 2.0]:
http://support.microsoft.com/?scid=kb;en-us;315291

I made an small installer app with VB6 and thus overcome the situation...

Could be interesting for me if anyone has made another approach.

Regards,
Petar Atanasov
http://a-wake.net
 
P

Petar Atanasov

Vlad said:
Thanks Peter.

I was in the middle of doing exactly that when I though "this is such a
hack... there's got to be a better way".
I found another way that *might* work. I can create a setup package for the
app and have the users run it instead - it installs .NET if its not already
there and solves a couple of other issues (security signing etc). However it
asks a user a bunch of questions... I would really like to bypass that and
have that install unattended - just run if .NET is there and install it
quietly and then run if it's not. Any ideas on how to make that happen and
take all those annoying dialogs away during install (including EULA)?

Thanks
Vlad

Petar Atanasov said:
Vlad said:
Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Thanks
Vlad
Hi, Vlad

I got the same issue on a project that worked on.
It occurred that one is unable to detect .NET framework from within...

So, check the registry with what you feel comfortable [VbSrcipt, Classic
VB, manually ;), etc] for the following [covering versions from 1.0 to 2.0]:
http://support.microsoft.com/?scid=kb;en-us;315291

I made an small installer app with VB6 and thus overcome the situation...

Could be interesting for me if anyone has made another approach.

Regards,
Petar Atanasov
http://a-wake.net

Sure, check out: http://www.devx.com/dotnet/Article/20849/0/page/1
But again - I don't find it much useful when it comes to detect/install
the .NET framework itself.

Regards,
Petar Atanasov
http://a-wake.net
 
J

juanmanuel.perezmojica

Hi everyone,

I'm very new to .NET and visual studio (2005). I am working on a simple
project that uses .NET 2.0.

Most client computers do not have .NET installed. So I need some pointers on
how to code the application so it detects if .NET is installed on the
computer; if it's not there - install and only then execute the main code.
When I run the app on a machine without .NET installed, it generates an
error and closes ("Failed to initialize") before it even gets to the part
that detects .NETs presense.
Any ideas/pointers/code on how to get around this problem are greatly
appreciated.

Thanks
Vlad

Vlad,

If you are using .NET 2.0 you could deploy your application using
ClickOnce:
http://msdn2.microsoft.com/en-us/netframework/aa497348.aspx

When you do it, ClickOnce will take care of installing .NET Framework
2.0 if it detects
that your client machine doesn't have it.

Bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top