468,250 Members | 1,600 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,250 developers. It's quick & easy.

vb.net Deployment - Storing the Installation Directory

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

Feb 28 '06 #1
1 1868
Jesse Albert wrote:
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
Mar 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Arun Bhalla | last post: by
2 posts views Thread by John Miner | last post: by
1 post views Thread by Steve | last post: by
5 posts views Thread by Grumpy Aero Guy | last post: by
1 post views Thread by SKarnis | last post: by
1 post views Thread by Gene | last post: by
6 posts views Thread by andrewbb | last post: by
4 posts views Thread by ochocki | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.