?
Solved

Help (.chm) file directory

Posted on 2004-11-18
6
Medium Priority
?
342 Views
Last Modified: 2010-04-15
The .Net platform makes use of .chm help files which can be launched by the System.Windows.Forms.Help class. However the Help class method call needs the directory path of the .chm file as an argument. I believe it is customery to put the .chm file in the app installation directory or its subdirectory, which is set by the user during installation. How would you programmatically find out the installation directory at run time?

Thanks

Bruce
0
Comment
Question by:bhomass
  • 3
  • 3
6 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 12617976
Hello

Use Application.StartupPath

MessageBox.Show(Application.StartupPath.ToString());

Regards,
0
 

Author Comment

by:bhomass
ID: 12618187
Thanks for the speedy reply.

You know what, normally this would be the right answer, except the app I am doing is an Excel add-in. the Application.StartupPath returns the installation directory of Excel.exe instead of my add-in .dll path. So I still need to know the right directory from the installation process.

Thanks

Bruce
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 12618722
Bruce

try this instead
MessageBox.Show(System.AppDomain.CurrentDomain.BaseDirectory.ToString());

HTH

Regards,
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:bhomass
ID: 12619392
Same result. points to Excel.exe.

Bruce
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 1000 total points
ID: 12619667
sorry, I just test it with normal exe file

try this too
      MessageBox.Show(Application.ExecutablePath.ToString());
      MessageBox.Show(System.Reflection.Assembly.GetExecutingAssembly().Location.ToString());
0
 

Author Comment

by:bhomass
ID: 12619802
All right. What a man!

ExecutablePath returns Excel path, but assembly location returned the .dll path.

Thanks and closed!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

839 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