Installation directory

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

Dear all,
I have created a class library DLL containing some functionalities. Then I
have created a"Setup and deployment" project in order to create the
installation kit. After this, I have installed it on my computer in a
directory.

Now the question: in my DLL's code there is a section where I try to write a
text file and I'd like to write it in the same directory where the DLL has
been installed. Is there a way to get directory where the DLL is "running"?

Thank you very much
 
Mario said:
Dear all,
I have created a class library DLL containing some functionalities. Then I
have created a"Setup and deployment" project in order to create the
installation kit. After this, I have installed it on my computer in a
directory.

Now the question: in my DLL's code there is a section where I try to write
a
text file and I'd like to write it in the same directory where the DLL has
been installed. Is there a way to get directory where the DLL is
"running"?

Thank you very much

If the dll is in the same folder as the application then you can use
App.path (for VB6) or Application.StartupPath() (for .Net).
However on Vista most users will not have the right to create or modify
files in the application folder.
You should look at using the the user's ApplicationData "Special" folder
which is the correct place for such files that the application is going to
modify.
 
Back
Top