473,756 Members | 7,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing Registry

I was wondering how I can programmaticall y 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 1919
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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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 programmaticall y 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
8150
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 (user) acknowleges to run this applet on his machine). The user has to read the existent user Microsoft Outlook users accounts and to setup another Microsoft Outlook user accont. As I know so far, that the only way is to access from the applet a...
6
2735
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
1675
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... http://www.wwwcoder.com/main/parentid/263/site/2281/68/default.aspx what's the problem with a server side application reading data from a server
9
241
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. I'm guessing that this can be done by accessing the registry, but some articles or sample code would be useful. Thanks.
2
2428
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 Microsoft.Win32.RegistryKey RegKey = Microsoft.Win32.Registry.LocalMachine RegKey = RegKey.OpenSubKey(KeyPath, True) but it gives me an error, unauthorized access of registry thanks
3
1924
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 that is accessing data stored in a SQL server database on a seperate server (not on the pocket pc). This wil be deployed to lots of customers sites so I can't hard-code the location of the database in the program. I wrote a seperate little app...
7
13628
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 registry and the following message appears: 'Error accessing the system registry'. I have tied to repair Access using the Office 2000 repair facility but no luck.
1
1411
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 through the program it spits it out to the user unencrypted). This encrypted password is stored in the registry. When I created it, I was an admin on the server where the registry was/is stored. But what I found out later, is that when regular...
1
1629
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 you decide otherwise. (Already forwarded here, sort-of, from: microsoft.public.windowsnt.registry.) I'm writing a Visual Basic program which stores and retrieves data in the registry - no big thing, I've got all that code written
0
9462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.