473,668 Members | 2,318 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Console application checking if .NET installed

If .NET is not installed my console application pops up "the application
failed to initialize properly" dialog.

Can I programatically tell if .NET is installed, and pre-emp this message
with my own ?

thanks
Feb 25 '08 #1
5 1866
Consider that the people not installing .NET might very well be some of
the same people that never runs Windows Update, so they would never have
this code that knew how to install .NET in the first place.
I can see your point, but .Net has bee around for a while, if Microsoft
would have started doing something about this issue since the very
beginning, *most* computer today would be able to handle this in a very
graceful way.

Yes I agree that there would always be a computer here or there that would
not be able to handle this, when this happens you will get an email and tell
the user how to fix the problem I guess.
Feb 25 '08 #2
"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Thanks Willy.

Your VBScript code checks the registry I think. I can check the regisry
from my Console App, but if .NET is not is not installed then the same
problem exists?

Is this Catch 22?
Exactly, you can't use a .NET program to check whether .NET is installed.
You need unmanaged code, and the easiest that comes to mind is a simple
script (vbscript, jscript), Windows comes with the scripting engines
installed by default.
Willy.

Feb 25 '08 #3
Its Catch 22 then. My app uses Managed code, and I dont wish to have 2
applications.

Thanks to everyone, B
"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:ek******** ******@TK2MSFTN GP02.phx.gbl...
"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>Thanks Willy.

Your VBScript code checks the registry I think. I can check the regisry
from my Console App, but if .NET is not is not installed then the same
problem exists?

Is this Catch 22?

Exactly, you can't use a .NET program to check whether .NET is installed.
You need unmanaged code, and the easiest that comes to mind is a simple
script (vbscript, jscript), Windows comes with the scripting engines
installed by default.
Willy.

Feb 25 '08 #4
No need to write two applications, say you have a console application
"someapp.ex e", then you can simply make a command line script like this:

@rem startapp.cmd
@Echo off
Set Version="HKLM\S OFTWARE\Microso ft\NET Framework Setup\NDP\v2.0. 50727"
reg query %version% /v Version >nul 2>nul
if not %errorlevel% == 0 (
Echo No such .Net version: %Version%
goto :end
)
someapp.exe
:end

Willy.

"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2******** ************@TK 2MSFTNGP06.phx. gbl...
Its Catch 22 then. My app uses Managed code, and I dont wish to have 2
applications.

Thanks to everyone, B
"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:ek******** ******@TK2MSFTN GP02.phx.gbl...
>"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2******* *********@TK2MS FTNGP02.phx.gbl ...
>>Thanks Willy.

Your VBScript code checks the registry I think. I can check the regisry
from my Console App, but if .NET is not is not installed then the same
problem exists?

Is this Catch 22?

Exactly, you can't use a .NET program to check whether .NET is installed.
You need unmanaged code, and the easiest that comes to mind is a simple
script (vbscript, jscript), Windows comes with the scripting engines
installed by default.
Willy.


Feb 25 '08 #5
Thanks, but I need a wrapper free solution.

I appreciate your help, B

"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
No need to write two applications, say you have a console application
"someapp.ex e", then you can simply make a command line script like this:

@rem startapp.cmd
@Echo off
Set Version="HKLM\S OFTWARE\Microso ft\NET Framework Setup\NDP\v2.0. 50727"
reg query %version% /v Version >nul 2>nul
if not %errorlevel% == 0 (
Echo No such .Net version: %Version%
goto :end
)
someapp.exe
:end

Willy.

"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2******** ************@TK 2MSFTNGP06.phx. gbl...
>Its Catch 22 then. My app uses Managed code, and I dont wish to have 2
applications .

Thanks to everyone, B
"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:ek******* *******@TK2MSFT NGP02.phx.gbl.. .
>>"Brian Stoop" <b.*****@consul tant-spam.free.comwr ote in message
news:%2****** **********@TK2M SFTNGP02.phx.gb l...
Thanks Willy.

Your VBScript code checks the registry I think. I can check the regisry
from my Console App, but if .NET is not is not installed then the same
problem exists?

Is this Catch 22?
Exactly, you can't use a .NET program to check whether .NET is
installed. You need unmanaged code, and the easiest that comes to mind
is a simple script (vbscript, jscript), Windows comes with the scripting
engines installed by default.
Willy.



Feb 26 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1536
by: Jim Heavey | last post by:
I have never built an application to distribute before and I am now ready to learn how to do this. I have a few questions to get me started. How do I associate my application with an Icon which show up on the task bar? If my application requires Sql Server installed, How can I test that it is installed? If Sql Server is not installed, can I/Should I include the MSDE product in
3
2288
by: Dave | last post by:
I created a console app in Visual Studio 2003 using C#. How to I distribute this app after I build it? It is my understanding that a C# app will run on any machine with the Net Framework installed. Do I simply copy the exe file to the machine on which the console app is to run?
6
10425
by: Giojo | last post by:
Hello guys! I can't resolve this problem.. I want my programm in c# working with only console if there are some parameters, but if someone make double-click on the exe I want to start the graphic GUI without the black console on background.. Now I check if there are some parameters and if there aren't parameters I run the GUI (with the black console that remain..). If I choose Windows application on Visual Studio, when I run the...
4
3488
by: dm1608 | last post by:
Hi -- I have a VB6 application that I plan on rewriting in C#.NET. The program today basically connects to a SQL Server and parses varies system stats from our mainframes and rolls the data up for up/downtime statistics, etc. Since the current program today requires me to click various buttons and tabs to load/review the information being parses and saved, I would like to implement this applications as both a Windows Forms and Console...
1
1384
by: Méta-MCI | last post by:
Good evening! I installed the Console of EFFBOT (http://effbot.org/downloads/#console). It functions well. It's a very fun/friendly tool. Except a detail: when I send (by console.write()) more than 53200 characters, it does not occur anything. I circumvented the problem, with a loop which sends ranges of 50000 characters.
2
1594
by: Demid | last post by:
Hi, all. I have recently written a small applpication that uses Microsoft CDO Library (cdo.dll) that is a set of COM-classes. I have added a reference to this library using standard "Add reference" dialog in Visual Studio, that has created required interop assemblies, and it works fine on my computer. But when the application is launched on another computer, it can not find this library (CDO) though it is properly installed and registered....
1
2037
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following error: The CLR has been unable to transition from COM context 0x1a2008 to COM context 0x1a2178 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long...
2
3111
by: Tatter | last post by:
I have a simple .NET 1.1 console application, written with Visual Studio .NET 2003, that needs to be run on a Windows XP system as a scheduled task. When run on its own, the program executes with no errors. When run as a scheduled task on a computer with debugging tools installed, it runs with no errors. When run as a scheduled task on a computer with no debugging tools installed, namely the Windows XP system it is supposed to be run on, it...
12
6526
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow combination to hide the console window at launch time. The application (for legacy reasons) hangs around by waiting on an old- fashioned Console.ReadLine() statement.
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.