vb.net Deployment - Storing the Installation Directory

J

Jesse Albert

I'm having a complete brainfart so I'll just let you all know the issue
and listen to any possible solution you can offer without asking for a
specific way to do this ;)

I have a Solution ( VB 2005) that consists of 3 projects: A Service, a
Configuration Project, and the Deployment project.

The config project is just the UI that will save settings to an XML
file in the installation directory.

The service loads this XML file.

The problem is that the Service needs to know where this XML file is
loaded. If I hard code the path into it, if the user does not choose
the default path then it will fail.

My work around is that when I save the XML document, I save the
complete path of this in the directory. The problem therein lies that
I have an OpenFileDialog for importing some things into the
configuration page. Doing this changes the working directory so that
the XML document is no longer saved in the installation's directory,
but somewhere else. Not a problem if I save the path of this document
every time, but rather sloppy to have a programs config file on the
desktop ;).

So basically...I'm looking for a way to Store the Installation
directory during setup time. Or possible even a better solution. I
think I've been looking at work arounds too long that I've made myself
blind to any good fix.

Thanks for the help!
-Jesse
 
G

Guest

Jesse said:
I'm having a complete brainfart so I'll just let you all know the issue
and listen to any possible solution you can offer without asking for a
specific way to do this ;)

I have a Solution ( VB 2005) that consists of 3 projects: A Service, a
Configuration Project, and the Deployment project.

The config project is just the UI that will save settings to an XML
file in the installation directory.

The service loads this XML file.

The problem is that the Service needs to know where this XML file is
loaded. If I hard code the path into it, if the user does not choose
the default path then it will fail.

My work around is that when I save the XML document, I save the
complete path of this in the directory. The problem therein lies that
I have an OpenFileDialog for importing some things into the
configuration page. Doing this changes the working directory so that
the XML document is no longer saved in the installation's directory,
but somewhere else. Not a problem if I save the path of this document
every time, but rather sloppy to have a programs config file on the
desktop ;).

So basically...I'm looking for a way to Store the Installation
directory during setup time. Or possible even a better solution. I
think I've been looking at work arounds too long that I've made myself
blind to any good fix.

Thanks for the help!
-Jesse

Why not use the Registry to save the location?

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top