help for changing the default installation folder

S

sunil

Hi,
I want to change the default installation folder to my own path. I did
it by changing the application folder's DefaultLocation property. The
installation works fine as long the path that I give is complete path.
If I give relative path, there is an error.
The path is relative to the location of my solution folder. Just to be
more clear, I have several projects in my solution. The setup project
contains one executable as the primary output. I have one more
executable in my solution. I want the DefaultLocation value to be the
same as the output path of the other executable.

Just to give you an example, lets assume the solution have 2
executables named A and B. I have a setup project for A. I want the
DefaultLocation value of the application folder to be the output value
of B (i.e., wherever that executable is to be output). B's output path
is relative to the location of the project folder. Is there a way to do
it?
 
D

Dave Sexton

Hi,

The location of the solution or its projects' output have nothing to do with
an installer. The installer knows nothing of the solution in which it was
built.

Unless you write a custom macro or add-in there is no way, AFAIK, to
dynamically link the DefaultLocation of the "Application Folder" to the
target directory of a project within the same solution, if that is in fact
what you're trying to do.

The value of DefaultLocation for the "Application Folder" uses some MSI
properties as such: [ProgramFilesFolder][Manufacturer]\[ProductName]. The
property is evaluated by the installer, not Visual Studio. The MSI property
associated with that folder is [TARGETDIR], which as you can see is quite
different from the IDE macro $(TargetDir), for example, which can be used in
custom build events for a specific project.

Your best option is probably to just hard-code DefaultLocation to the path
that you want before building the installer. You can use MSI properties to
make it somewhat dynamic:

Property Reference
http://msdn2.microsoft.com/en-us/library/aa370905.aspx

Another option is to create a macro or add-in that can set the value for you
based on some project's $(TargetDir) value, but it's probably not worth the
effort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top