Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How can I change the TARGETDIR value at runtime?

0 views
Skip to first unread message

Michael Sanford [MVP]

unread,
Mar 14, 2005, 8:31:55 PM3/14/05
to
Hello Mark,

Well sure it is! Actually there are a lot of ways to control this. Can
you provide more info about what you are trying to do?

The simplest way is to set the value on the commandline like so:
msiexec /i mypackage.msi TARGETDIR="C:\Program Files\Foo"

Michael Sanford
Windows Installer MVP


> I'm using VS 2003, I have been research on the web by 3 days, if is
> possible to change the value of the TARGETDIR at runtime. And how set
> default dialogs values at runtime.
>
> Is there a way? perhaps using the installer class?
>
> Thanks for your comments
>


s2w2k2

unread,
Mar 15, 2005, 3:47:01 AM3/15/05
to
You can also use the TARGETDIR property

For more information refer to the following:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/targetdir.asp

Mark

unread,
Mar 15, 2005, 9:43:09 AM3/15/05
to
Hi everyone,

I actually I'm looking for a file ascent.dll; if I found it I want to use
its path otherwise I'll use my predefined path.

Thanks guys

Michael Sanford [MVP]

unread,
Mar 15, 2005, 11:29:12 AM3/15/05
to
Hello Mark,

Ok, so you need to create a file search action, and if the property containing
the result is not null, then set TARGETDIR to that value. I'm not sure how
to do this in VS.NET, but a combination of a System Search and a Custom Action
should do the trick.

If you can't get it working, let me know and I'll take a look as VS.NET.

Michael Sanford
Windows Installer MVP

s2w2k2

unread,
Mar 15, 2005, 11:35:07 AM3/15/05
to
You can search for a file and create a Property holding the File's path. For
further information, refer to the following:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/searching_for_a_file_and_creating_a_property_holding_the_file_s_path.asp

Assign the Property created to TARGETDIR

0 new messages