Make a VS.NET setup project save the installation path into the registry

Hello,

I wrote an application using VS.NET 2003 C#. To deploy it I'm using the tool which comes with the VS.NET (by adding a Setup and Deployment Project).

I need my application to know what is the installation folder the user has choosen at the setup procedure, and I guess the registry will do the job. The problem is that I don't know how to make the setup project save that path into the registry.

Is it possible..? (I know other tools like InstallShield is able to do that using parameters)
How it is done using VS.NET?

Thanks for your help.
LVL 4
ben-gurAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

toddhdCommented:
I'm not sure how you make the setup program do that, but I'm also not sure why you would need it in the registry. Just pull the application path from the executable at first launch, like this:

  Dim aPath As String = Application.ExecutablePath()

or this would do the same thing without the executable name attached:

Dim aPath As String = Application.StartupPath()

So in your Form_Load, call the above, then save it to registry for future use if you need it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ben-gurAuthor Commented:
Thank you for your reply. I was not aware of this option, and I've implemeted it in my code.

I needed it to to be able to access my data files, no matter where from the user executes the application. But due to the lack of functionality (as far as I know..) in VS.NET I had to change my app.

Thank you very much for you help, please accept the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.