MORE INFORMATION
MDAC and DCOM are vital to many applications written for
the Win32 platform.
A requirement of the
Application
Specification for Microsoft Windows 2000 for Desktop Applications
desktop applications is to use the Windows Installer. However, because MDAC and
DCOM redistributable merge modules do not exist, DCOM and MDAC installation
must be done outside of a Windows Installer .msi file. You can use this sample,
Wrapper.exe, as-is or modify it to meet custom needs.
The following file
is available for download from the Microsoft Download
Center:
Release Date: August
31, 2000
For additional information about how to download Microsoft
Support files, click the following article number to view the article in the
Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
Command Line Options
Wrapper.exe command line switches are the same as the Windows
Installer, Msiexec.exe. For example, the following command line would install
and create a verbose log file:
C:\Wrapper> Wrapper.exe /i MyMsi.MSI /l*v C:\Wrapper\MyLog.txt
For more information, visit the following Microsoft Web
site:
Command
Line Options To customize your wrapper and build in the
command line parameters, modify the function call to RegWriteCmdLine in
MTSetup.cpp as in the following example code:
if(!lstrcmp(__argv[1],"DCOMREBOOT"))
{
...
}
else if(!lstrcmp(__argv[1],"MDACREBOOT"))
{
...
}
else
{
// Comment out the following line
//RegWriteCmdLine(lpCmdLine);
RegWriteCmdLine(TEXT("/i MyInstallationPackage.MSI"));
}
Directory Structure
The following directory structure is required by Wrapper.exe:
- DCOM98 and MDAC setup packages (DCOM95.EXE and
MDAC_TYP.EXE) must be placed in the same folder as Wrapper.exe. Setup will fail
if these files are not present
- The Windows Installer redistributable files, InstMsi.exe,
must be placed in different "WinNT" and "Win9x" subfolders of the folder where Wrapper.exe resides. Obtain the
Windows Installer redistributables by downloading these files from the
following Microsoft Web site:
- You can place the MSI package anywhere in the folder
structure as long as the appropriate path is included on the command
line.
MDAC
Wrapper.exe only checks for the presence of MDAC 2.1 or later. If
a specific version is required for your application, you must customize the
source code. The
IsMDACPresent function in MDAC.cpp is the location of the check.
Wrapper.exe will install the version of MDAC (MDAC_TYP.exe) that you place in
the Wrapper.exe folder. For example, if you place version 2.5 of MDAC in the
Wrapper.exe folder, version 2.5 will be installed. Several different versions
of MDAC are available from:
You must be a local administrator on the computer in order to
install MDAC.
DCOM
DCOM must only be installed on computers running Windows 95. It
is already present in Windows 98, Windows 98SE, Windows NT 4.0, and Windows
2000. The redistributable version of DCOM is available at the following Web
site:
Renaming the Executable
If you want to rename the executable file, do the following:
- Modify the following variable in MTSetup.h:
static const TCHAR g_szAppName[] = TEXT("Wrapper");
- On the Project menu, click Settings.
- Select the Link tab.
- In the Category list, select General.
- Modify the output file name.
- Recompile.
Installation Algorithm
Wrapper.exe performs the following detection and installation
tasks:
- On Windows 95, installs DCOM if it is not present and
reboots the computer.
- Uses Instmsi.exe to install the Windows Installer service
if it is not present.
- Installs MDAC if it is not present and reboots the
computer.
- Installs the MSI package specified by the command
line.
The self-extracting file WrapperSetup.exe contains the
following files:
|
MTSetup.dsw | 537 bytes |
MTSetup.dsp | 4.87 KB |
MTSetup.cpp | 2.06 KB |
MTSetup.h | 1.17 KB |
DCOM.cpp | 2.47 KB |
MDAC.cpp | 2.11 KB |
Registry.cpp | 5.40 KB |
MsgLoop.cpp | 780 bytes |
Init.cpp | 1.44 KB |
Security.cpp | 1.09 KB |
Version.cpp | 965 bytes |
Stdafx.cpp | 294 bytes |
CmdLine.cpp | 960 bytes |
Installer.cpp | 1.95 KB |
InstallThread.cpp | 2.90 KB |
Wrapper.exe | 28 KB |
Msiexec.ico | 4.59 KB |
Script1.rc | 2.79 KB |
Stdafx.h | 773 bytes |
What's New in WrapperSetup.exe (6/21/2000 and later)
- The executable performs additional MDAC
detection.
- A RunOnce registry key bug was fixed.
- An icon was added to the executable.
- A version resource was added to the executable.
- The executable will run from a root directory.
- A long filename directory bug was fixed.