Using difx:Driver in WiX to install a device driver with subdirectories

Discussion in 'Windows Vista Drivers' started by Richard Amos, May 28, 2008.

  1. Richard Amos

    Richard Amos Guest

    I'm trying to create an MSI, using WiX to install a device driver that have
    i386/ and amd64/ directories off the main driver directory (containing the
    ..INF file). I use the difx:Driver tag in the component containing the .INF
    file to have it copied to System32/DriverStore/, but I don't know how to get
    the subdirectories copied there as well? Any ideas?

    I know this isn't a WiX forum, but I've tried there. As WiX is really just a
    very thin wrapper over the MSI stuff, I thought someone here may have some
    Richard Amos, May 28, 2008
    1. Advertisements

  2. Richard Amos

    Abjad Hawwaz Guest

    Why would you want to have both 32-bit and 64-bit driver on the same
    machine? Besides, shouldn't you have separate MSI files for the different
    platforms? The MSI file contains target platform information in the summary
    stream and will refuse to run on the wrong processor type.

    If I remember right, DIFx tools don't like it if the driver component files
    are in separate directories. I am not sure I understand your situation, but,
    based on what I see, you could keep the INF file in a different directory
    from the other driver files on the source disk, but then copy all of them
    into the same target directory on the host. Then DIFx tools should take care
    of everything automatically.
    Abjad Hawwaz, Jun 4, 2008
    1. Advertisements

  3. Richard Amos

    craig.e.shea Guest

    I'm with Richard; I too, have a driver that has both 32-bit and 64-bit
    versions. While I am not trying to put both versions into the same
    MSI, the files are broken up like so:


    where <DriverDir> contains the 2 main *.inf files for the PORt and BUS
    devices and the i386 directory contains the 32-bit drivers. The
    drivers are signed, so it's not like I can just go change the INF

    How would I use DIFxApp with Wix to specify the installation sources
    using the folder structure above?

    I'd appreciate to hear from anyone with any knowledge on this subject.


    Craig S.
    craig.e.shea, Jun 4, 2008
  4. Richard Amos

    Abjad Hawwaz Guest

    This is a quote from the Organizing Applications into Components topic in
    the MSDN Library

    The installer installs all of the resources in a component into the same
    directory. It is not possible to install some resources into subdirectories.

    I couldn't find any direct confirmation that all of the resources of a
    component must reside in the same source folder, but, chances are, they
    must. The Component table of an MSI database has a Directory entry for the
    entire component. There appears to be no way to specify different locations
    for different resources. If DIFxApp requires that all files in a driver
    package belong to a single component, then there seems to be no way to use
    DIFxApp and MSI with the directory structure you have.
    I am cross-posting this message in the MSI newsgroup
    (microsoft.public.platformsdk.msi) to see if there's an MSI expert who could
    confirm or refute my conclusion.
    Abjad Hawwaz, Jun 5, 2008
  5. Richard Amos

    Pavel A. Guest

    Make all source filenames unique, in one flat directory,
    and then rename them at install time - like this:

    Source files:

    In the INF:

    my.sys, x86_my.sys

    my.sys, x64_my.sys

    However, this will copy all files to the driver store, even these that will
    never be installed.

    Pavel A., Jun 5, 2008
  6. Not sure what the issue is here. Renaming files at install time is
    swimming against the tide and could have all sorts or unforeseen
    consequences for things like rollbacks and patching.

    With DifxApp you let MSI install your files to a standard folder on
    the target machine, e.g. under the program files folder, and then you
    let DifXApp (via the information in the .inf file) perform the
    remainder of the physical and logical installation of the drivers into
    the Drivers folder. It's really important that you don't use the MSI
    tables to install the files directly into the drivers folder as
    DifXApp may break if there is >1 catalog file in the drivers folder.
    [I see you don't mention catalog files, but for forward compatibility
    you might want to investigate using them.]

    As far as renaming the files at install time goes, this may cause
    problems down the line, such as with patching files and the like. You
    might find it easier to do something along the following lines:

    Create 2 components, one for your x86 files and another for your x64
    files, and give them mutually exclusive component conditions based on
    the processor architecture so that only one of the components is ever
    installed on a particular system. That way you don't need to worry
    about file name collisions on the target system as you'll only ever
    install one or other of the components. And it keeps the install
    footprint smaller.

    If you are planning to patch this install, then you should also take
    care that the component 'source' directories are unique (e.g. sys_x86
    and sys_x64 otherwise when you create the admin image during patch
    creation the .sys files will collide and overwrite one another.

    Stephen Connolly, Jun 6, 2008
  7. Richard Amos

    Pavel A. Guest

    Patching? you can't patch a file staged in the driver store.
    Rollback should work.
    Hmm. Yes, the INF syntax doesn't allow rename of catalogs...
    This may require separate INF files for each arch, because
    all files referenced by the INF must be present in order to
    put the package into the store?
    OTOH if MSI installs different files with same names depending on
    the target, the checksum in the .cat won't match.

    Then it's better just to create separate packages for each arch,
    and use INF syntax to prevent installation on a wrong arch.

    Pavel A., Jun 6, 2008
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.