Home All Groups Group Topic Archive Search About

Check if libraries or program exist

Author
19 Nov 2007 2:53 PM
Freddy Coal
Hi, I would like know if something libraries or programs exist, and send
error with a description if the program don't find the libraries, how can
make that?.

For example:

In the use of interop libraries of Office, I declare that libraries in the
begin of code:

Imports Microsoft.Office.Interop

But when the user don't have that libraries, the program don't run
(inmediate crash, they don't start), and the user never know the failure
point.

Thanks in advance for any help.

Freddy Coal

Author
19 Nov 2007 3:09 PM
rowe_newsgroups
Show quote Hide quote
On Nov 19, 9:53 am, "Freddy Coal" <freddyc...@gmaiwithoutspam.com>
wrote:
> Hi, I would like know if something libraries or programs exist, and send
> error with a description if the program don't find the libraries, how can
> make that?.
>
> For example:
>
> In the use of interop libraries of Office, I declare that libraries in the
> begin of code:
>
> Imports Microsoft.Office.Interop
>
> But when the user don't have that libraries, the program don't run
> (inmediate crash, they don't start), and the user never know the failure
> point.
>
> Thanks in advance for any help.
>
> Freddy Coal

I believe if you use ClickOnce deployment you can set prerequisites
that must be installed with the application. If they do not exist (and
can't be downloaded) a more descriptive error message will be shown to
the user.

Also, I don't believe the program should crash until it tries to
reference the missing library. If that's true, you should be able to
use a simple try...catch block to handle the errors and display a more
helpful error message.

Thanks,

Seth Rowe
Author
20 Nov 2007 3:58 PM
Freddy Coal
Seth, How put external programs like prerequisites with ClickOnce?. The Try
cath, only work inside class, I have global variables, exist a way to put
external Try Catch?.

For example, I have this code:

'--------------------
Imports EARTHLib

Public Class FC_Form

Dim camara As New CameraInfoGE
Dim GEarth As New EARTHLib.ApplicationGE

Private Sub FC_Form_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
'---------------------

In the code I'm using Google Earth, but if the user don't have the
application, the program crash, the program don't start.

Thanks in advance for your help.

Freddy Coal.


Show quoteHide quote
"rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message
news:79a9e79c-16b6-4d44-970d-644f61bbdfeb@c30g2000hsa.googlegroups.com...
> On Nov 19, 9:53 am, "Freddy Coal" <freddyc...@gmaiwithoutspam.com>
> wrote:
>> Hi, I would like know if something libraries or programs exist, and send
>> error with a description if the program don't find the libraries, how can
>> make that?.
>>
>> For example:
>>
>> In the use of interop libraries of Office, I declare that libraries in
>> the
>> begin of code:
>>
>> Imports Microsoft.Office.Interop
>>
>> But when the user don't have that libraries, the program don't run
>> (inmediate crash, they don't start), and the user never know the failure
>> point.
>>
>> Thanks in advance for any help.
>>
>> Freddy Coal
>
> I believe if you use ClickOnce deployment you can set prerequisites
> that must be installed with the application. If they do not exist (and
> can't be downloaded) a more descriptive error message will be shown to
> the user.
>
> Also, I don't believe the program should crash until it tries to
> reference the missing library. If that's true, you should be able to
> use a simple try...catch block to handle the errors and display a more
> helpful error message.
>
> Thanks,
>
> Seth Rowe
Author
20 Nov 2007 4:12 PM
Armin Zingler
Show quote Hide quote
"Freddy Coal" <freddycoal@gmaiwithoutspam.com> schrieb
> Seth, How put external programs like prerequisites with ClickOnce?.
> The Try cath, only work inside class, I have global variables, exist
> a way to put external Try Catch?.
>
> For example, I have this code:
>
> '--------------------
> Imports EARTHLib
>
> Public Class FC_Form
>
> Dim camara As New CameraInfoGE
> Dim GEarth As New EARTHLib.ApplicationGE
>
> Private Sub FC_Form_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> End Sub
> '---------------------
>
> In the code I'm using Google Earth, but if the user don't have the
> application, the program crash, the program don't start.

        Dim camara As CameraInfoGE
        Dim GEarth As EARTHLib.ApplicationGE

        Sub New
            try
                camara =new CameraInfoGE
                GEarth =new EARTHLib.ApplicationGE
            catch ex as exception
                'handle exception
            end try
        end sub



Armin
Author
20 Nov 2007 4:33 PM
rowe_newsgroups
Show quote Hide quote
On Nov 20, 10:58 am, "Freddy Coal" <freddyc...@gmaiwithoutspam.com>
wrote:
> Seth, How put external programs like prerequisites with ClickOnce?. The Try
> cath, only work inside class, I have global variables, exist a way to put
> external Try Catch?.
>
> For example, I have this code:
>
> '--------------------
> Imports EARTHLib
>
> Public Class FC_Form
>
> Dim camara As New CameraInfoGE
> Dim GEarth As New EARTHLib.ApplicationGE
>
> Private Sub FC_Form_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> End Sub
> '---------------------
>
> In the code I'm using Google Earth, but if the user don't have the
> application, the program crash, the program don't start.
>
> Thanks in advance for your help.
>
> Freddy Coal.
>
> "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message
>
> news:79a9e79c-16b6-4d44-970d-644f61bbdfeb@c30g2000hsa.googlegroups.com...
>
> > On Nov 19, 9:53 am, "Freddy Coal" <freddyc...@gmaiwithoutspam.com>
> > wrote:
> >> Hi, I would like know if something libraries or programs exist, and send
> >> error with a description if the program don't find the libraries, how can
> >> make that?.
>
> >> For example:
>
> >> In the use of interop libraries of Office, I declare that libraries in
> >> the
> >> begin of code:
>
> >> Imports Microsoft.Office.Interop
>
> >> But when the user don't have that libraries, the program don't run
> >> (inmediate crash, they don't start), and the user never know the failure
> >> point.
>
> >> Thanks in advance for any help.
>
> >> Freddy Coal
>
> > I believe if you use ClickOnce deployment you can set prerequisites
> > that must be installed with the application. If they do not exist (and
> > can't be downloaded) a more descriptive error message will be shown to
> > the user.
>
> > Also, I don't believe the program should crash until it tries to
> > reference the missing library. If that's true, you should be able to
> > use a simple try...catch block to handle the errors and display a more
> > helpful error message.
>
> > Thanks,
>
> > Seth Rowe

To be honest, I've only used ClickOnce prerequisites for Microsoft
products like Office and Sql Server, and never any third party
libraries. You best bet is to search Google or MSDN and try to find
some instructions. Armin has already shown you how to properly
instantiate the "unstable" code, so you might not need to worry about
the prereq's if it does what you require.

Thanks,

Seth Rowe