Discussion:
Accessing Registry
(too old to reply)
Swami
2005-08-17 16:46:04 UTC
Permalink
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.
billr
2005-08-17 20:18:01 UTC
Permalink
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
Post by Swami
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.
Swami
2005-08-18 16:09:03 UTC
Permalink
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
billr
2005-08-18 16:16:09 UTC
Permalink
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
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Swami
2005-08-18 16:24:05 UTC
Permalink
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
billr
2005-08-18 16:27:03 UTC
Permalink
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
Post by Swami
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Swami
2005-08-18 16:31:06 UTC
Permalink
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
billr
2005-08-18 16:38:05 UTC
Permalink
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
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Swami
2005-08-18 16:51:07 UTC
Permalink
Thanks! That answers my question :-)
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
billr
2005-08-18 16:55:07 UTC
Permalink
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/default.aspx?dg=microsoft.public.dotnet.general&mid=94c60db4-e855-4cd9-9983-db398ae39fe1
--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
Post by Swami
Thanks! That answers my question :-)
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
Thanks, I found it. How do I specify the variable to determine the path of
the application directory?
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Post by billr
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"
http://greyskin.co.uk
Post by Swami
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.
Loading...