Está en la página 1de 5

TWM Installation Package

Introduction
The purpose of this document is to outline the structure, build process, installation
process, and discuss issues that contributed to the current structure of the install kit
for TWM.

Contents
The install kit contains everything needed to install and run TWM on Windows XP,
Vista, and Windows 7 32bit and 64 PCs. Items necessary to install TWM include:
1. A self extracting archive for encompassing the whole install kit and used to
distribute to users.
2. A .MSI installation file containing nearly all necessary information for
installing TWM and the WinUSB driver.
3. The DifxApp Utility for installing the WinUSB driver package
4. Visual C++ 2005 SP1 redistributable installer that installs Microsoft runtime
libraries required by TWM to run.
5. An additional application, named InstallHelper, used to configure the .MSI file
to specifically target the PC TWM will install on and run the runtime library
installer.
The install kit includes other files needed by TWM to run correctly on the target
machine including the TWM program itself, the WinUSB driver package, the Well
Analyzer firmware files, help documentation, and optional files such as example well
files.
The self extracting archive contains the entire install kit and is what we distribute to
clients/users. It contains 4 files: the .MSI installation file, the runtime library
installer, InstallHelper, and the setup program. All other files are contained within
the .MSI file.
The .MSI holds all of the information necessary for Windows to install TWM and the
WinUSB driver package. It supports clean installations and replacement/upgrade
installations. It is designed to install TWM on both 32 bit and 64 bit Windows.
The DifxApp utility handles installing driver packages. It is the recommended
method for installing drivers when distributing them with an install kit of an
application. It is used by adding a merge module to an installation project in Visual
Studio, building the project, then running a post build script that modifies the .MSI
file to designate driver packages to install.

The Visual C++ 2005 SP1 redistributable installer installs runtime libraries and
configuration required by applications created with Visual Studio C++ 2005 SP1 to
run on machines without Visual Studio installed. The runtime libraries are also
included in the .MSI as a merge module.
The InstallHelper will configure the .MSI to specifically target the operating system
architecture (32bit or 64 bit Windows) TWM will be installed on. It also acts as the
bootstrap for the runtime libraries installer and the setup program.

Build Process
Visual Studio handles the majority of the build process itself. All files added to the
installer project are added to the .MSI based on properties set within Visual studio
for that file. It handles detecting dependencies and merging merge modules to the
MSI.
There are two tasks it is unable to perform. The first is specifying WinUSB as a driver
package to be installed with TWM. We have a post build script called EditMsi.vbs
that adds an entry to the MsiDriverPackages table in the output .MSI for the WinUSB
driver package. The entry references the inf file of the driver.
The second task is building the install kit into the self extracting archive. We do this
by running the IExpress utility in combination with a .sed configuration file to build
the archive.

Installation Process
The installation process starts out with the self extracting archive extracting its
contained files; in this case, the .MSI, InstallHelper, setup, and runtime library
installer. It then executes the InstallHelper application. InstallHelper configures
the .MSI based on the PCs operating system architecture and runs the runtime
library installer for Vista systems. Then it runs the setup program, which begin the
installation for TWM and the WinUSB driver.

Driver Installation Problem


Normally, Windows installers target only one specific operating system architecture,
either 32bit or 64bit Windows. Microsoft built two different merge modules to add
the DifxApp utility to .MSI files with this in mind. The 64bit merge module includes
the 64 bit version of the DifxApp utility and the 32 bit merge module includes the 32
bit version of the DifxApp utility. As a result, two separate installers must be built to
support installation on both architectures.

Figure 1 Standard DifxApp Merge Modules and the resulting installers

However, we wanted to support installing TWM on both architectures with just one
install kit. We decided to create our own custom DifxApp merge module that would
include both versions of the DifxApp utility.

Figure 2 - Custom DifxApp Merge module for a universal installer

This wasnt as straightforward as combining the components of the two merge


modules. The DifxApp utility is intimately tied with the .MSI it is merged with,
particularly with the use of custom actions. Three custom actions, MsiDriverinstall,
MsiDriverUninstall, and MsiDriverRollback, all originally hooked directly into DifxApp
dll s for the target operating system architecture; i.e., when merging the DifxApp
32bit Merge Module to an .MSI, the custom actions hooked directly into a 32bit
DifxApp dll, and likewise for the 64bit DifxApp merge module the custom actions
hooked directly into a 64bit DifxApp dll. Because both 32bit and 64bit dlls are
included in the custom merge module, and the target operating system architecture
is not known at build time, the custom actions cannot be set. Instead, they must be
set at runtime. This is where the InstallHelper application comes in.
The InstallHelper application checks the operating system architecture and adds the
three custom actions, targeted to the appropriate dll, to the installer. This
guarantees the correct DifxApp utility is used on the users PC. After the
InstallHelper configures the .MSI, it runs the setup program which begins the
installation for TWM.

Vista Compatibility issue


When an application is built in Visual Studio that uses specific Windows runtime
libraries, such as MFC and ATL, the application needs to be distributed with those
libraries. Microsofts solution for this is to simply add merge modules for the
respective libraries to the installation project of the application. When the
application is installed, the libraries are installed and configured to be used with the
application. For the most part, this works. However, due to a bug in
replacement/upgrade installations on Vista that include the Visual Studio C++ 2005
runtime libraries, the application is not configured correctly to use those libraries. As
a result, a side by side configuration error occurs.
Side by side configuration errors do not occur if the runtime libraries are installed
independently from an application prior to the replacement install taking place.
Thus, our solution to this problem involves installing the runtime libraries separately
from the application prior to installation. To do this, the InstallHelper runs the
installer for the runtime libraries prior to initiating the setup process. To simplify the
installation of the runtime libraries for the user, the installer is run in passive mode,
requiring no input from the user but allows them to see a dialog box displaying the
progress bar while installing the runtime libraries. If the runtime libraries are already
installed, the installer is smart enough to not reinstall and just exits.
As a side note, the runtime library merge modules are still merged with the .MSI for
Windows XP and Windows Vista.

También podría gustarte