473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Accessing Registry

I was wondering how I can programmatically find out the path of an installed
program. I have an application that needs access to a config file that
resides in the folder of another application. I'm guessing that this can be
done by accessing the registry, but some articles or sample code would be
useful.

Thanks.
Aug 17 '05 #1
9 1874
Unfortunately this is only going to be the case if the application you are
interested in makes an entry in the Registry, and not all applications do
(especially .NET apps)

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I was wondering how I can programmatically find out the path of an installed
program. I have an application that needs access to a config file that
resides in the folder of another application. I'm guessing that this can be
done by accessing the registry, but some articles or sample code would be
useful.

Thanks.

Aug 17 '05 #2
I guess now my question is how to make the entry for install directory into
the registry? I can add a key "InstallDir" for my .NET installation, but is
there any property that I can add for the "Value" filed so that the path can
evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
there is anythign like that in .NET.

Thanks.

"billr" wrote:
Unfortunately this is only going to be the case if the application you are
interested in makes an entry in the Registry, and not all applications do
(especially .NET apps)

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I was wondering how I can programmatically find out the path of an installed
program. I have an application that needs access to a config file that
resides in the folder of another application. I'm guessing that this can be
done by accessing the registry, but some articles or sample code would be
useful.

Thanks.

Aug 18 '05 #3
Yes, my friend, there most definately is.

Use the .Net setup project to create your msi, and whilst in design view,
you can add entries to the system registry

open the solution explorer window, and along the top you will see a bunch of
icons you should be able to easily recognise the registry icon :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I guess now my question is how to make the entry for install directory into
the registry? I can add a key "InstallDir" for my .NET installation, but is
there any property that I can add for the "Value" filed so that the path can
evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
there is anythign like that in .NET.

Thanks.

"billr" wrote:
Unfortunately this is only going to be the case if the application you are
interested in makes an entry in the Registry, and not all applications do
(especially .NET apps)

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I was wondering how I can programmatically find out the path of an installed
program. I have an application that needs access to a config file that
resides in the folder of another application. I'm guessing that this can be
done by accessing the registry, but some articles or sample code would be
useful.

Thanks.

Aug 18 '05 #4
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?

"billr" wrote:
Yes, my friend, there most definately is.

Use the .Net setup project to create your msi, and whilst in design view,
you can add entries to the system registry

open the solution explorer window, and along the top you will see a bunch of
icons you should be able to easily recognise the registry icon :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I guess now my question is how to make the entry for install directory into
the registry? I can add a key "InstallDir" for my .NET installation, but is
there any property that I can add for the "Value" filed so that the path can
evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
there is anythign like that in .NET.

Thanks.

"billr" wrote:
Unfortunately this is only going to be the case if the application you are
interested in makes an entry in the Registry, and not all applications do
(especially .NET apps)

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:

> I was wondering how I can programmatically find out the path of an installed
> program. I have an application that needs access to a config file that
> resides in the folder of another application. I'm guessing that this can be
> done by accessing the registry, but some articles or sample code would be
> useful.
>
> Thanks.

Aug 18 '05 #5
I don't know if there is any standard for this, so my advice would be create
a key with a meaningful name.
--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?

"billr" wrote:
Yes, my friend, there most definately is.

Use the .Net setup project to create your msi, and whilst in design view,
you can add entries to the system registry

open the solution explorer window, and along the top you will see a bunch of
icons you should be able to easily recognise the registry icon :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I guess now my question is how to make the entry for install directory into
the registry? I can add a key "InstallDir" for my .NET installation, but is
there any property that I can add for the "Value" filed so that the path can
evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
there is anythign like that in .NET.

Thanks.

"billr" wrote:

> Unfortunately this is only going to be the case if the application you are
> interested in makes an entry in the Registry, and not all applications do
> (especially .NET apps)
>
> --
> Of all words of tongue and pen, the saddest are: "It might have been"
>
> Bill.Richards @ greyskin .co .uk
> http://greyskin.co.uk
>
>
> "Swami" wrote:
>
> > I was wondering how I can programmatically find out the path of an installed
> > program. I have an application that needs access to a config file that
> > resides in the folder of another application. I'm guessing that this can be
> > done by accessing the registry, but some articles or sample code would be
> > useful.
> >
> > Thanks.

Aug 18 '05 #6
I can create the key with a meaningful name--but what do I specify for its
"value" so that the application directory path would be evaluated and stored
in the registry for that key?

Thanks.
"billr" wrote:
I don't know if there is any standard for this, so my advice would be create
a key with a meaningful name.
--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?

"billr" wrote:
Yes, my friend, there most definately is.

Use the .Net setup project to create your msi, and whilst in design view,
you can add entries to the system registry

open the solution explorer window, and along the top you will see a bunch of
icons you should be able to easily recognise the registry icon :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:

> I guess now my question is how to make the entry for install directory into
> the registry? I can add a key "InstallDir" for my .NET installation, but is
> there any property that I can add for the "Value" filed so that the path can
> evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
> there is anythign like that in .NET.
>
> Thanks.
>
>
>
> "billr" wrote:
>
> > Unfortunately this is only going to be the case if the application you are
> > interested in makes an entry in the Registry, and not all applications do
> > (especially .NET apps)
> >
> > --
> > Of all words of tongue and pen, the saddest are: "It might have been"
> >
> > Bill.Richards @ greyskin .co .uk
> > http://greyskin.co.uk
> >
> >
> > "Swami" wrote:
> >
> > > I was wondering how I can programmatically find out the path of an installed
> > > program. I have an application that needs access to a config file that
> > > resides in the folder of another application. I'm guessing that this can be
> > > done by accessing the registry, but some articles or sample code would be
> > > useful.
> > >
> > > Thanks.

Aug 18 '05 #7
ahhhh, now I get ya. Sorry for being a little slow -it's been a very long
week :o))

So, what you need to do is create a custom action (look that up in the help
docs), and link that into your installer.

So, part of the install process is asking the user to set the installation
directory, you capture this datum and enter that into your registry :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I can create the key with a meaningful name--but what do I specify for its
"value" so that the application directory path would be evaluated and stored
in the registry for that key?

Thanks.
"billr" wrote:
I don't know if there is any standard for this, so my advice would be create
a key with a meaningful name.
--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?

"billr" wrote:

> Yes, my friend, there most definately is.
>
> Use the .Net setup project to create your msi, and whilst in design view,
> you can add entries to the system registry
>
> open the solution explorer window, and along the top you will see a bunch of
> icons you should be able to easily recognise the registry icon :o))
>
> --
> Of all words of tongue and pen, the saddest are: "It might have been"
>
> Bill.Richards @ greyskin .co .uk
> http://greyskin.co.uk
>
>
> "Swami" wrote:
>
> > I guess now my question is how to make the entry for install directory into
> > the registry? I can add a key "InstallDir" for my .NET installation, but is
> > there any property that I can add for the "Value" filed so that the path can
> > evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
> > there is anythign like that in .NET.
> >
> > Thanks.
> >
> >
> >
> > "billr" wrote:
> >
> > > Unfortunately this is only going to be the case if the application you are
> > > interested in makes an entry in the Registry, and not all applications do
> > > (especially .NET apps)
> > >
> > > --
> > > Of all words of tongue and pen, the saddest are: "It might have been"
> > >
> > > Bill.Richards @ greyskin .co .uk
> > > http://greyskin.co.uk
> > >
> > >
> > > "Swami" wrote:
> > >
> > > > I was wondering how I can programmatically find out the path of an installed
> > > > program. I have an application that needs access to a config file that
> > > > resides in the folder of another application. I'm guessing that this can be
> > > > done by accessing the registry, but some articles or sample code would be
> > > > useful.
> > > >
> > > > Thanks.

Aug 18 '05 #8
Thanks! That answers my question :-)

"billr" wrote:
ahhhh, now I get ya. Sorry for being a little slow -it's been a very long
week :o))

So, what you need to do is create a custom action (look that up in the help
docs), and link that into your installer.

So, part of the install process is asking the user to set the installation
directory, you capture this datum and enter that into your registry :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I can create the key with a meaningful name--but what do I specify for its
"value" so that the application directory path would be evaluated and stored
in the registry for that key?

Thanks.
"billr" wrote:
I don't know if there is any standard for this, so my advice would be create
a key with a meaningful name.
--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:

> Thanks, I found it. How do I specify the variable to determine the path of
> the application directory?
>
>
>
> "billr" wrote:
>
> > Yes, my friend, there most definately is.
> >
> > Use the .Net setup project to create your msi, and whilst in design view,
> > you can add entries to the system registry
> >
> > open the solution explorer window, and along the top you will see a bunch of
> > icons you should be able to easily recognise the registry icon :o))
> >
> > --
> > Of all words of tongue and pen, the saddest are: "It might have been"
> >
> > Bill.Richards @ greyskin .co .uk
> > http://greyskin.co.uk
> >
> >
> > "Swami" wrote:
> >
> > > I guess now my question is how to make the entry for install directory into
> > > the registry? I can add a key "InstallDir" for my .NET installation, but is
> > > there any property that I can add for the "Value" filed so that the path can
> > > evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
> > > there is anythign like that in .NET.
> > >
> > > Thanks.
> > >
> > >
> > >
> > > "billr" wrote:
> > >
> > > > Unfortunately this is only going to be the case if the application you are
> > > > interested in makes an entry in the Registry, and not all applications do
> > > > (especially .NET apps)
> > > >
> > > > --
> > > > Of all words of tongue and pen, the saddest are: "It might have been"
> > > >
> > > > Bill.Richards @ greyskin .co .uk
> > > > http://greyskin.co.uk
> > > >
> > > >
> > > > "Swami" wrote:
> > > >
> > > > > I was wondering how I can programmatically find out the path of an installed
> > > > > program. I have an application that needs access to a config file that
> > > > > resides in the folder of another application. I'm guessing that this can be
> > > > > done by accessing the registry, but some articles or sample code would be
> > > > > useful.
> > > > >
> > > > > Thanks.

Aug 18 '05 #9
Perhaps you could click the link to say that the information was helpful.

If you didn't access via the msdn website, here is the link (I ask this
because it will be helpful for other community users)
http://msdn.microsoft.com/newsgroups...3-db398ae39fe1

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
Thanks! That answers my question :-)

"billr" wrote:
ahhhh, now I get ya. Sorry for being a little slow -it's been a very long
week :o))

So, what you need to do is create a custom action (look that up in the help
docs), and link that into your installer.

So, part of the install process is asking the user to set the installation
directory, you capture this datum and enter that into your registry :o))

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Swami" wrote:
I can create the key with a meaningful name--but what do I specify for its
"value" so that the application directory path would be evaluated and stored
in the registry for that key?

Thanks.
"billr" wrote:

> I don't know if there is any standard for this, so my advice would be create
> a key with a meaningful name.
>
>
> --
> Of all words of tongue and pen, the saddest are: "It might have been"
>
> Bill.Richards @ greyskin .co .uk
> http://greyskin.co.uk
>
>
> "Swami" wrote:
>
> > Thanks, I found it. How do I specify the variable to determine the path of
> > the application directory?
> >
> >
> >
> > "billr" wrote:
> >
> > > Yes, my friend, there most definately is.
> > >
> > > Use the .Net setup project to create your msi, and whilst in design view,
> > > you can add entries to the system registry
> > >
> > > open the solution explorer window, and along the top you will see a bunch of
> > > icons you should be able to easily recognise the registry icon :o))
> > >
> > > --
> > > Of all words of tongue and pen, the saddest are: "It might have been"
> > >
> > > Bill.Richards @ greyskin .co .uk
> > > http://greyskin.co.uk
> > >
> > >
> > > "Swami" wrote:
> > >
> > > > I guess now my question is how to make the entry for install directory into
> > > > the registry? I can add a key "InstallDir" for my .NET installation, but is
> > > > there any property that I can add for the "Value" filed so that the path can
> > > > evaluated? I knwo for InstallShield they have [INSTALLDIR]...I wonder if
> > > > there is anythign like that in .NET.
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >
> > > > "billr" wrote:
> > > >
> > > > > Unfortunately this is only going to be the case if the application you are
> > > > > interested in makes an entry in the Registry, and not all applications do
> > > > > (especially .NET apps)
> > > > >
> > > > > --
> > > > > Of all words of tongue and pen, the saddest are: "It might have been"
> > > > >
> > > > > Bill.Richards @ greyskin .co .uk
> > > > > http://greyskin.co.uk
> > > > >
> > > > >
> > > > > "Swami" wrote:
> > > > >
> > > > > > I was wondering how I can programmatically find out the path of an installed
> > > > > > program. I have an application that needs access to a config file that
> > > > > > resides in the folder of another application. I'm guessing that this can be
> > > > > > done by accessing the registry, but some articles or sample code would be
> > > > > > useful.
> > > > > >
> > > > > > Thanks.

Aug 18 '05 #10

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

Similar topics

3
by: Daniel Pope | last post by:
Hello Everybody, I'm preparing for doing a daunting task: to access Out look Microsoft Outlook Express(regardles the operating system and Outlook version) from a Java applet (after the client...
6
by: Alex5222 | last post by:
I am making a program in C++ and was wondering how to make a program access and change the registry. Any help would be greatly appreciated. Thanks.
2
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... ...
9
by: Swami | last post by:
I was wondering how I can programmatically find out the path of an installed program. I have an application that needs access to a config file that resides in the folder of another application. ...
2
by: Mostafa Salama | last post by:
i have a problem in accessing registry from web service i made a web service that call a function to access registry The web service contain the following code Dim RegKey As...
3
by: mark.jerrom | last post by:
I'm fairly new to this Web Service game so please feel free to suggest something different if it looks like i'm completely off track! I'm trying to write an application that runs on a Pocket PC...
7
by: Cogito | last post by:
I installed Office 2000 Professional onto a Windows Vista laptop and when I tried to compile the code the following error message appears: 'User-Defined type not defined' I went to check the...
1
by: JLC | last post by:
Hi, I am trying to write a small windows application that you enter a domain\username and a key and hit enter. When you do this, the program will retrieve the password (which was encrypted, but...
1
by: David Schrader | last post by:
Hello all, Let me start by saying that I'm not certain whether this belongs here, in this notes group, or another more developmentally oriented one. I'll try starting here then go elsewhere if...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.