Update of existing .NET App - How to find the application path? 
Author Message
 Update of existing .NET App - How to find the application path?

Let's assume there is a customer which has installed a .NET application in a
certain application path i.e. "C:\Program Files\MyNetApp". Now he wants to
install an update from the internet and downloads an SETUP.EXE from our
internet site. Now the update installation program has to find the path
where the application was installed. What is the best practice to find this
path in a .NET environment?

Here are some ideas, but none of them I really like much:

a) On first install, write the install path somewhere in the registry.

Read the path from the registry on update. - This can't be the right way
since .NET app should avoid the registry altogether (which I generally find
a good idea)

b) Search for the app executable on all local drives - no good idea

because of possible name clashes and old versions of the executable in
temporary folders that may be lying around

c) Keep a small .INI or .XML file in C:\WINNT\System32 or so where the

actual application setup path is being stored - can't be good either, since
I don't want my apps to put anything into the C:\WINNT folder (for security
and permission reasons).

So what is the "official" way?

Thanks for any suggestions!

Urs Eichmann

PRISMA Informatik AG

Dietlikon, Switzerland

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://www.*-*-*.com/ .



Tue, 08 Jun 2004 21:43:21 GMT  
 Update of existing .NET App - How to find the application path?
Unfortunately, you are correct in your choices. While having apps that can be
installed via xcopy is great, the trade off is, of course, that other apps have
no way of determining where anything is installed.

The best choice is to have your app write a key to the registry. This is pretty
standard practice and the good thing is that the app itself doesn't need to rely
on the registry keys, only the upgrade app. However, if for some reason the reg
key is missing your fallback option should be to give the user a choice of
whether they want to select the directory the app is installed in or having the
install proggy search the HD.

Your suggested option C is no different than writing a key to the registry and
an ini file is more likely to be deleted.

Hope this helps!

Michael G. Emmons

On Fri, 21 Dec 2001 14:43:21 +0100, "Urs Eichmann"

Quote:

>Let's assume there is a customer which has installed a .NET application in a
>certain application path i.e. "C:\Program Files\MyNetApp". Now he wants to
>install an update from the internet and downloads an SETUP.EXE from our
>internet site. Now the update installation program has to find the path
>where the application was installed. What is the best practice to find this
>path in a .NET environment?

>Here are some ideas, but none of them I really like much:

>a) On first install, write the install path somewhere in the registry.

>Read the path from the registry on update. - This can't be the right way
>since .NET app should avoid the registry altogether (which I generally find
>a good idea)

>b) Search for the app executable on all local drives - no good idea

>because of possible name clashes and old versions of the executable in
>temporary folders that may be lying around

>c) Keep a small .INI or .XML file in C:\WINNT\System32 or so where the

>actual application setup path is being stored - can't be good either, since
>I don't want my apps to put anything into the C:\WINNT folder (for security
>and permission reasons).

>So what is the "official" way?

>Thanks for any suggestions!

>Urs Eichmann

>PRISMA Informatik AG

>Dietlikon, Switzerland

>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

Michael G. Emmons
Independent Consultant &
Software Architect



Wed, 09 Jun 2004 00:00:41 GMT  
 Update of existing .NET App - How to find the application path?
You could combine option (b) with a version check :D

Craig



Wed, 09 Jun 2004 01:15:04 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Finding App Path in .Net

2. Finding Application path of VB .Net project

3. using application path (app.path)

4. Finding if File and Path Exists?

5. VB.NET: Steps for Converting a Windows .NET Application to a Web .NET Application

6. App.path at .Net

7. How to get App.Path in VB.NET

8. What's the equivalence of APP.PATH of VB6 in VB.NET

9. App.Path in Visual Basic .NET

10. VB.NET Equivalent of APP.Path in VB6

11. Couldn't find net path or user name

12. Finding Path to VB app's executable

 

 
Powered by phpBB® Forum Software