Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2004-10-28
Medium Priority
Last Modified: 2011-04-14

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.
Question by:ben-gur
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

toddhd earned 800 total points
ID: 12435910
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.

Author Comment

ID: 12437944
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.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

609 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