How does the installer know what the customer has ordered?

To me this sounds like each database set is a feature that the customer can 
choose to install. The feature for db1 would contain references to components 
that represent the contents of db1.cab. You could partition your installer so 
that all the components for each database set are stored in the same media. 
Assuming that I'm not missing something obvious then you don't have to do any 
work other than specifying the resources, components, features, and media as 
Windows Installer would do all the work for laying down the appropriate 
components given the selected features.

<Product ...>
  <Package .../>

  <!-- one media for each database set -->
  <Media Id="1" Cabinet="db1.cab" EmbedCab="yes"/>
  <Media Id="2" Cabinet="db2.cab" EmbedCab="yes"/>

  <!-- specify one feature for each database set -->
  <Feature Id="db1" Title="Database Set 1" Level="1">
    <ComponentGroupRef Id="db1"/>
  </Feature>
  <Feature Id="db2" Title="Database Set 2" Level="1">
    <ComponentGroupRef Id="db2"/>
  </Feature>

  <!-- specify what makes up a database set -->
  <ComponentGroup Id="db1">
    <ComponentRef Id="jet-db1"/>
    <ComponentRef Id="db1-readme.txt"/>
    <ComponentRef Id="db1-manual.doc"/>
  </ComponentGroup>
  <ComponentGroup Id="db2">
    <ComponentRef Id="jet-db2"/>
    <ComponentRef Id="db2-readme.txt"/>
  </ComponentGroup>

  <!-- specify your components -->
  <DirectoryRef Id="Db1Folder">
    <Component Id="jet-db1" Disk="1" Guid="PUT-GUID-HERE">
      <File Id="jet-db1" Name="jet-db1-target-filename" 
Source="path\to\source\jet-db1"/>
    </Component>
    <Component Id="db1-readme.txt" Disk="1" Guid="PUT-GUID-HERE">
      <File Id="db1-readme.txt" Name="readme.txt" 
Source="path\to\source\db1-readme.txt"/>
    </Component>
    <Component Id="db1-manual.doc" Disk="1" Guid="PUT-GUID-HERE">
      <File Id="db1-manual.doc" Name="manual.doc" 
Source="path\to\source\db1-manual.doc"/>
    </Component>
  </DirectoryRef>
  <DirectoryRef Id="Db2Folder">
    <Component Id="jet-db2" Disk="2" Guid="PUT-GUID-HERE">
      <File Id="jet-db2" Name="jet-db2-target-filename" 
Source="path\to\source\jet-db2"/>
    </Component>
    <Component Id="db2-readme.txt" Disk="2" Guid="PUT-GUID-HERE">
      <File Id="db2-readme.txt" Name="readme.txt" 
Source="path\to\source\db2-readme.txt"/>
    </Component>
  </DirectoryRef>

</Product>

In my installers I typically only have one Feature that always gets installed. 
I believe Windows Installer uses the value of Feature/@Label to determine 
whether it should install that feature or not. The WiX and Windows Installer 
documentation has more information on how to select features to install, etc. 
(I set Label="1" above and that's probably not what you want.)

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail


> -----Original Message-----
> From: Nick Ball [mailto:nick.b...@grantadesign.com]
> Sent: Friday, March 06, 2009 9:22 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Installing files only if they exist
>
> Hi All,
>
>
>
> Firstly, let me confess that I'm new to Windows Installer and WiX,
> coming from a rather antiquated WISE install system (10 years old!) and
> finally embracing the modern way.
>
>
>
> Amongst other things, something I'm trying to do is install files only
> if they exist. Our system ships with various databases, which can be
> specific to a given customer. Each database set consists of the
> database, plus some supporting docs. The database is jet-based, so this
> is just a file copy, nothing more.
>
>
>
> I want to bundle each database set into a .cab file, then drop these
> onto the disk depending on what the customer has ordered. Then I would
> like the installer to interrogate the disk and extract and copy any
> databases it might find. So, my databases may be packaged into:
>
>
>
> Db1.cab
>
> Db2.cab
>
> Db3.cab
>
> Etc..
>
>
>
> The installer would check for the existence of db1.cab, and then
> extract
> the contents to the install folder (and subfolders depending on what is
> in the cab). My thinking is that I need to do a FileSearch for each of
> the cab files and set a property accordingly, then use a condition for
> each database component, although I haven't tried this yet. Am I on the
> right lines here? And how might I go about simply extracting the
> files/folders from the cab file to the target machine?
>
>
>
> Thanks
>
>
>
> Nick
>
> -----------------------------------------------------------------------
> -------
> Open Source Business Conference (OSBC), March 24-25, 2009, San
> Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> Enterprise
> -Strategies to boost innovation and cut costs with open source
> participation
> -Receive a $600 discount off the registration fee with the source code:
> SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to