Firstly don't use TARGETDIR as a ConfigurableDirectory as TARGETDIR is
the root element of your directory tree & used for other things such as
administrative installations (see ->
http://msdn.microsoft.com/en-us/library/aa372064.aspx). You main issue
seems to stem from confusing TARGETDIR with INSTALLDIR/INSTALLLOCATION.

Put all your application files under INSTALLDIR e.g.

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="CompanyFolder" Name="My Company">
          <Directory Id="INSTALLDIR" Name="My Product">
          ...

Secondly if you want to have multiple Features with Configurable
Directories then first build your directory tree as you would expect for
a default installation & simply change the Directory ID's for the
directories you wish to make Configurable in your Features to public
properties (you can use INSTALLDIR as is)

          <Directory Id="INSTALLDIR" Name="My Product">
              <Component Id="MyComponent" Guid="PUT-GUID-HERE">
              ...
            <Directory Id="INSTALLDIR2" Name="My Feature 2">
              <Merge Id="MyMergeModule" DiskId="1" Language="0"
SourceFile="myfeature.msm" />
              ...

You could then use INSTALLDIR & INSTALLDIR2 in the above example for the
ConfigurableDirectory attribute in your Feature Elements.

That should get you started.

Palbinder Sandher 
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500 
F: +44 (0) 141 945 8501 

http://www.iesve.com 
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456 
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP
Email Disclaimer

-----Original Message-----
From: Umesh Joglekar [mailto:umesh_jogle...@hotmail.com] 
Sent: 29 July 2010 06:34
To: WixUsers
Subject: [WiX-users] Configurabble Install Directory


 
In our installer we would like to allow the users to select install
directory. However, we want to install it one directory off of user's
choice. i.e. if the user chooses c:\ we want to install it to c:\MyApp.
 
I am able to achieve this with

<Property Id="INSTALLDIR" Value ="[TARGETDIR]\MyAPP"/> <Directory
Id="TARGETDIR"  ...> <Directory Id="INSTALLDIR" Name="."> .
.
</Directory>
</Directory>

<Feature Id="MyFeature1" ConfigurableDirectory="INSTALLDIR" Level="1">
<Component..../> </Feature>

Our product has two features First one is in wxs file but second is in a
merge module. It is written in the wxs file and works well if
installation is done at TARGETDIR which is chosen by the user. With the
above mentioned scheme also it ends up at TARGETDIR instead of
installing at TARGETDIR\Myapp. 

Second feature is also coded with ConfigurableDirectory as INSTALLDIR

<Feature Id="MyFeature2" ConfigurableDirectory="INSTALLDIR" Level="1">

What do I need to do to make sure that both features are installed at
TARGETDIR\MyApp ?

I have also tried  to use a custom action at the beginning of
InstallExecuteSequence to reset INSTALLDIR to TARGETDIR\MyApp. It seems
to me that the target address of components in the merge module gets
resolved as soon as the user makes a selection of TARGETDIR so any
resetting later makes no difference but for the components in the
feature in wxs file, target adress gets resolved after the INSTALLDIR is
reset. 

Thanks.
 
Umesh
                                          
------------------------------------------------------------------------
------
The Palm PDK Hot Apps Program offers developers who use the Plug-In
Development Kit to bring their C/C++ apps to Palm for a share of $1
Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to