473,385 Members | 1,973 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,385 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 2506
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.