473,382 Members | 1,386 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,382 software developers and data experts.

Installed program path

Is possible to find where program is installed in the cases if path is
changed during installation?

Can you point me to specific information? If possible, real code sample.

Thanks I appreciate your help.
Nov 17 '05 #1
6 2505
Hello

It should be somewhere in registry. There is "Software" key in
HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER. Usually (a good manner) is to
create your own subkey under the software key for your application during
installation. So do most of installers (if you don't write your own). So,
try to check the registry.

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"Washington" <ab******@yahoo.com> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl...
Is possible to find where program is installed in the cases if path is
changed during installation?

Can you point me to specific information? If possible, real code sample.

Thanks I appreciate your help.

Nov 17 '05 #2
Hello

It should be somewhere in registry. There is "Software" key in
HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER. Usually (a good manner) is to
create your own subkey under the software key for your application during
installation. So do most of installers (if you don't write your own). So,
try to check the registry.

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"Washington" <ab******@yahoo.com> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl...
Is possible to find where program is installed in the cases if path is
changed during installation?

Can you point me to specific information? If possible, real code sample.

Thanks I appreciate your help.

Nov 17 '05 #3
Hi,

You can always find the directory path of the exe that started an
application using:

string myAppPath = Application.StartupPath;

Regards,

Rami Farhat


You can always use Application.

"Washington" wrote:
Is possible to find where program is installed in the cases if path is
changed during installation?

Can you point me to specific information? If possible, real code sample.

Thanks I appreciate your help.

Nov 17 '05 #4
Hi,

You can always find the directory path of the exe that started an
application using:

string myAppPath = Application.StartupPath;

Regards,

Rami Farhat


You can always use Application.

"Washington" wrote:
Is possible to find where program is installed in the cases if path is
changed during installation?

Can you point me to specific information? If possible, real code sample.

Thanks I appreciate your help.

Nov 17 '05 #5
"Rami Farhat" <Rami Fa****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi,

You can always find the directory path of the exe that started an
application using:

string myAppPath = Application.StartupPath;

Regards,

Rami Farhat


You can always use Application.


Wrong - only in a Windows Forms app can Application be used.

Even in a Windows Form app, I would still stay away from startup path, as
that does not actually indicate the location of the .exe file. For example,
if you had a shortcut to the EXE (say, on the start menu) you can go to it's
properties and change the startup path to some different directly.

The way I've normally gone about getting the location of the current exe is
to do something like this (if there is an easier way, let me know ;) )

string exeName = Assembly.GetExecutingAssembly().GetModules()[0].Name;
string path =
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
path = path.Substring(0, path.Length - exeName.Length);

--
Adam Clauss
Nov 17 '05 #6
"Rami Farhat" <Rami Fa****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi,

You can always find the directory path of the exe that started an
application using:

string myAppPath = Application.StartupPath;

Regards,

Rami Farhat


You can always use Application.


Wrong - only in a Windows Forms app can Application be used.

Even in a Windows Form app, I would still stay away from startup path, as
that does not actually indicate the location of the .exe file. For example,
if you had a shortcut to the EXE (say, on the start menu) you can go to it's
properties and change the startup path to some different directly.

The way I've normally gone about getting the location of the current exe is
to do something like this (if there is an easier way, let me know ;) )

string exeName = Assembly.GetExecutingAssembly().GetModules()[0].Name;
string path =
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
path = path.Substring(0, path.Length - exeName.Length);

--
Adam Clauss
Nov 17 '05 #7

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

Similar topics

1
by: Rahul Apte | last post by:
How do I programmatically check whether ASP and Server Side Includes sub-components of the World Wide Web service are installed on a Windows 2003 Box? I want to do these checks as pre-install...
32
by: deko | last post by:
I'm trying to create an MSI in VS.NET that will check for installed Office System components - so my MDE will only install if requirements are met. I'm thinking about using VBScript to inspect...
6
by: Tee | last post by:
Hi, I am creating a VS .NET Add-in. There's an xml config file that will installed to same folder as the DLL is installed. The installation path probably is something like C:\Program...
1
by: BuddyWork | last post by:
Hello, When a particular user (has administrator rights) on a Windows 2000 Server SP4 tries to run any MSI's we get the message mentioned in the subject. If we logon with another user that has...
3
by: Shelby | last post by:
Hi, how can I get the in which I installed the program? I tried: - System.Windows.Forms.Application.StartupPath - System.Environment.CurrentDirectory both does not return me the path in which...
1
by: Will Arrowsmith | last post by:
Hi all, I am trying to create a small form much like the Windows Explorer 'open with...' dialog box, which will contain a list of all applications installed on the local machine and their...
6
by: Ray | last post by:
I've just installed Python 2.4.3 on windows 2000. On the download page it says that if python is installed the version number will be displayed if you enter "python" in a command line window, but...
1
by: Leonid Lastovkin | last post by:
I would like to be able to find out which version of Microsoft Office is installed on the host computer. How can I implement this query in C#? I do not need the whole program, but a relevant code...
2
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi anyone, I have installed an Windows Forms Application (developed using VS 2005). My application appears in Control Panel -Add/Remove Programs. The path can be default path or if the user...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.