471,330 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 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 1734
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Daniel Pope | last post: by
6 posts views Thread by Alex5222 | last post: by
9 posts views Thread by Swami | last post: by
2 posts views Thread by Mostafa Salama | last post: by
3 posts views Thread by mark.jerrom | last post: by
1 post views Thread by JLC | last post: by
1 post views Thread by David Schrader | last post: by

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.