• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

How to change custom folder path using its property in Visual Studio Setup project?

I have Visual Studio 2010.

I want to dynamically change the path of the custom folder. When you add a custom folder using File System editor inside Setup there is a Property called Property and the description says:
"Specifies a named property that can be accessed at installation time to override the path of custom folder"
Documentation doesn't say anything about it.

How do I do that?
1 Solution

Did you happen to leave out the name of the property in the following sentence?

"... there is a Property called Property ..."
HenrikNordborgAuthor Commented:
No. It is called property and it is referred the same on MSDN, but they just say property property, so it's more confusing.
Vadim RappCommented:
This means that you can specify a property of the installation, in sense of http://msdn.microsoft.com/en-us/library/aa372432%28v=vs.85%29.aspx . Make up your own name, and specify. The point of this is that the value of this Property will be filled somewhere during the installation. For example, this property may be linked to a message box on a dialog. Or it can be the result of system search. So when your installation decides what will be that custom folder, it will have to store its path in that Property.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

HenrikNordborgAuthor Commented:
I know what it means, that is not the problem. On the page you specified it says this:
"You can get or set properties from programs and custom actions..."

So it can be set with the custom action, the question is how? What is the right procedure?
Vadim RappCommented:
If you are using Visual Studio setup and deployment, you can't do it by custom action. The reason is, this setup project supports only so called delayed custom actions, that do things on the destination computer after the installation has already completed. While in this case custom action would have to run at the early stage and affect the installation itself. This is possible with professional MSI authoring tools such as Installshield and Wise.

In those delayed custom actions, you access Installer session via Context. But because the installation has already finished, only a few properties are available, mainly the property named CustomActionData.  See "Walkthrough: Using a Custom Action to Create a Database at Installation" where the installation passes to the custom action the name of the database.

Paul Wilson wrote an extensive article "Visual Studio Setup - projects and custom actions" on the subject.

Unlike custom actions, System Search runs in the beginning of the installation, and you can have it returning the result in any standard property that is later used by the installation. For example, you can find the directory where Microsoft Office is installed, return it in the property TARGETDIR, and thus have your product installed in that directory. This is standard move when creating various add-ons.
I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned and is now flagged for deletion.

If there is a valid solution, please OBJECT and indicate the comments that are, or would otherwise lead to, a solution.

Use the specific format https:#axxxxxxxx for comment ID(s).

Also, please don't object simply because the author did not respond to your comment. While we understand this is frustrating, unfortunately we cannot force the author to return to the question. Unless you feel you have presented a valid, verifiable solution we'll simply delete the question.

Experts-Exchange Auto Deleter
Vadim RappCommented:
The complete answer is in ID: 35344418. Accept ID: 35344418.
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now