?
Solved

Finding the install directory of an application

Posted on 2005-04-20
10
Medium Priority
?
209 Views
Last Modified: 2011-10-03
I need to get the installation of my installed application on the fly. HOw do I do this?

I tried this already..

appPath = System.Reflection.Assembly.GetExecutingAssembly.Location


but when I debug my executing dll seems to be the one in my development area not my release area.
0
Comment
Question by:jayrod
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 2

Assisted Solution

by:SThorogood
SThorogood earned 1000 total points
ID: 13823341
Can you describe the paths to the various files - develepment, release, installation etc. Are you using VS.NET?
0
 
LVL 3

Author Comment

by:jayrod
ID: 13823689
yep.. vs.net.. I've cretaed an add-in solution so it uses the same setup as that project.

0
 
LVL 2

Expert Comment

by:SThorogood
ID: 13823818
I'm not too familar with using/debugging installed apps but have you tried using:

AppDomain.CurrentDomain.BaseDirectory

as a way of resolving the base path?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:jayrod
ID: 13823950
Nope.. that doesn't work either. I can't believe a thing like this is this friggin hard to do :(
0
 
LVL 11

Expert Comment

by:jatinderalagh
ID: 13824103
Application.ExecutablePath;
Application.StartupPath;
0
 
LVL 11

Accepted Solution

by:
jatinderalagh earned 1000 total points
ID: 13824119
Class is in System.Windows.Forms namespace
0
 
LVL 3

Author Comment

by:jayrod
ID: 13824341
nope... still no go there.. The application is a .NET Add-in so it doesn't have a form :(
0
 
LVL 5

Expert Comment

by:soumya_parida
ID: 13824920
If you are checking the path while debugging, then it would give the path of your debug version and not the release version. To check the path in your release version , try to write the path into a file at runtime and check whether it is giving the correct result.
Again if you debug and try to see the value by adding watch it will not give the correct path, it would give the "debug" executables path in the developement folder.
0
 
LVL 11

Expert Comment

by:jatinderalagh
ID: 13826242
System.Environment.CurrentDirectory property
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question