How to get installaed path of an application ?

  • Thread starter Thread starter Harsha
  • Start date Start date
H

Harsha

I have deployed an application abc.exe in a folder called xyz under program
files in windows mobile as \Program Files\xyz\abc.exe. abc.exe should return
me path where it is installed. even though I change foldername or path,
dynamically it should return the path where it is deployed. Please let me
know how can find that path programatically using C#.

Thanks in advance.
Harsha.
 
thanks Michal,
Please let me know what are refrences I need to include. such as using
System.Io and what else I need to include ?

Thanks again for help.
Harsha.
 
Thank you very much Michal.
I could resolve it. Thank you very much.
Have a nice day.

Regards,
Harsha.
 
Thanks Michal. This fixed my issue.
I included using System.Reflection; and using System.IO;
Thank you very much. Have a nice day.
 
Hi Michal,

Using the below code I can find out the installed path of an application.
And now I want to know the path till its parent folder. Is there any chance
to know the path till parent folder ?

string appPath =
Path.GetDirectoryName( Assembly.GetExecutingAssembly().GetName().CodeBase );

Thank you very much for your continoues support.

harsha.
 
Huh? You have the complete path and now you want the path to the parent
folder? Really?! How about just backing up to the next backslash in the
path?

Paul T.
 
What does that mean? You want to know the parent folder? Use
Path.GetDirectoryName on the path to where you are - maybe you have to strip
off Path.FIleName, I don't recall offhand, but the point is that the Path
class has everything you need to determine Path info.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
Thanks Paul,

as of now I have done same thing. But still I wanted to know is there any
chance to get the path of the parent folder. If not also don't worry.. Still
its working fine.

You people are of great help for me.. Thank you very much. Have a nice day.

Thanks and Regards,
harsha.
 
No, not with a single call. Then you'd want the parent of the parent,
right? You see where that goes.

Paul T.
 
Back
Top