Solved

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

Posted on 2004-10-28
345 Views
Last Modified: 2011-04-14
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.
0
Question by:ben-gur
    2 Comments
     
    LVL 8

    Accepted Solution

    by:
    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
     
    LVL 4

    Author Comment

    by:ben-gur
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: JavaScript Coding - Massive 12-Part Bundle

    Regardless of your programming skill level, you'll go from basics to advanced concepts in a vast array of JavaScript subjects including Sammy.js, Agility.js, Ember.js, Node.js, jQuery, AJAX, Extjs, AngularJS, Knockout.js, and JSON.

    In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…
    This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.

    934 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now