HOWTO: Add DirectX 8.1 Support to your Setup Factory 6.0 Installation
Document ID: IR04043The information in this article applies to:
- Setup Factory 6.0
SUMMARY
This document provides instructions for adding DirectX 8.1 support to your Setup Factory 6.0 installation.
DISCUSSION
In order to properly add DirectX 8.1 support to your Setup Factory 6.0 installation you will need to download the DirectX 8.1 developer redistributable: DX81Redist.exe (~24.5 MB)
DX81Redist.exe can be downloaded from: http://msdn.microsoft.com/directx
Once you run this file it will extract all the files you need to distribute. It is recommended that you save your files in the following directory:
...\Setup Factory 6.0\Runtimes\DirectX81\
This will place all the files you need to distribute in the following directory:
...\Setup Factory 6.0\Runtimes\DirectX81\Redist\DirectX81
Note: The redistributable files are also included in the full DirectX 8.1 SDK download (DX81SDK_FULL.exe) or on the DirectX 8.1 SDK CD-ROM. The necessary files will be located in the Redist folder. If you want you can copy the entire Redist folder into the following directory:
...\Setup Factory 6.0\Runtimes\DirectX81\
Compatibility Information
DirectX 8.1 is designed for the following Windows Operating Systems: Windows 98, ME, and 2000.
Windows XP: DirectX 8.1 is the version of Direct X that ships with Windows XP, therefore no installation is necessary.
Windows 95: DirectX 8.1 is not supported on Windows 95. However, DirectX 8.0a is supported on Windows 95, the download can be found here: http://www.microsoft.com/directx/homeuser/downloads/default.asp
Windows NT 4.0: DirectX Media 6 is the highest DirectX release for Windows NT 4.0. Service Pack 3.0 or higher must be installed in order to support this. DirectX Media 6 can be downloaded from: http://www.microsoft.com/directx/homeuser/downloads/default.asp
Developer Notes
This document will explain how to distribute DirectX 8.1 via CD-ROM.
After following the steps outlined in the Necessary Configuration section you should have the following files located in your ...\Setup Factory 6.0\Runtimes\DirectX81\Redist\DirectX81
directory:
BDA.cab
BDANT.cab
cfgmgr32.dll
DirectX.cab
DSETUP.dll
dsetup32.dll
dxnt.cab
dxsetup.exe
setupapi.dll
These files need to be located on your CD-ROM for distribution. Indigo Rose Software recommends (and this document assumes) that the above files are located in a folder named DirectX81 on the root of your CD-ROM. Therefore the above files will be found with the following paths on your CD-ROM:
- ...\DirectX81\BDA.cab
- ...\DirectX81\BDANT.cab
- ...\DirectX81\cfgmgr32.dll
- ...\DirectX81\DirectX.cab
- ...\DirectX81\DSETUP.dll
- ...\DirectX81\dsetup32.dll
- ...\DirectX81\dxnt.cab
- ...\DirectX81\dxsetup.exe
- ...\DirectX81\setupapi.dll
The nice thing about using Microsoft's DirectX installation is that it has all of the processing built into to it for you, all you have to do is launch it. Even if you decided to launch the DirectX 8.1 installation on a Windows 95 machine (where it is not supported) the installation would inform the user that DirectX 8.1 is not supported on their Operating System.
We will want to launch the DirectX 8.1 installation at the end out our installation so we will add the following actions to the Shutdown tab of the Actions dialog. You can acess this dialog from the menu under: Design | Actions.
The first thing to do is check if the current user has a compatible operating system, so we will add an IF control structure. We will make the IF condition as follows:
(!%IsWin95%) AND (!%IsWinNT4%) AND (!%IsWinNT3%) AND (!%IsWinXP%)
This basically translates to: If "the operating system is not Windows 95" AND "the operating system is not Windows NT 4.0" AND "the operating system is not Windows NT 3.0" AND "the operating system is not Windows XP" then do the following.
The next thing to check is the user's version of DirectX; if they already have DirectX 8.1 (or a newer version) installed on their system then we do not want to run the DirectX 8.1 installation. In order to do this we will need to read the current version of DirectX from the Registry. We will add a Read From Registry action, directly after the If control structure.
The Read From Registry action will look like this:
Variable Name: %DXVersion%
Default Value: 0.0.0
Main Key: HKEY_LOCAL_MACHINE
Sub Key: Software\Microsoft\DirectX
Value Name: Version
Set "Variable" to True if key exists: Unchecked
Auto-expand if value is of type REG_EXPAND_SZ: Unchecked
The above action will store the current version of DirectX on the user's system, in the variable %DXVersion%. We will then compare this version to the version that we are going to install. If the user's version is older than our version we are going to run the DirectX 8.1 installation. In order to do this we need to use another If control structure. The version of DirectX that we are installing will write: 4.08.01.0881 into the registry, so we will compare that with what is stored in %DXVersion%. Here is the IF condition:
(%DXVersion% < 4.08.01.0881)
This translates to: If "the user's DirectX version is less than the version we are going to install" then continue.
The next action will be the execution of the DirectX 8.1 installation using an Execute File action. Given the directory structure discussed above, our Execute File action will look like this:
File to execute: %SrcDrv%\DirectX81\dxsetup.exe
Command line arguments:
Working directory:
Run Mode: Normal
Wait for program to finish running before continuing: Unchecked
This Execute File action will execute the DirectX 8.1 installation that is found on your CD-ROM.
Note: The built-in variable %SrcDrv% is used in the action. It will be expanded, at runtime, to be the root of your CD-ROM.
In the end your action list will look something like this:
If ((!%IsWin95%) AND (!%IsWinNT4%) AND (!%IsWinNT3%) AND (!%IsWinXP%))
Read from Registry(%DXVersion% = HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\Vers ion)
If (%DXVersion% < 4.08.01.0881)
Execute(%SrcDrv%\DirectX81\dxsetup.exe)
END IF
END IF
The above actions with insure that DirectX 8.1 will be installed as long as the user has an earlier version of DirectX and is running a compatible operating system.
Some additional processing may be necessary, depending on your application you may want to install DirectX 8.0a on your user's system if they are running Windows 95. Or you may want to install DirectX Media 6 if your user is running Windows NT 4.0.
Note: The DirectX 8.1 installation will often require a reboot in order to fully complete. If you want to launch your application after the reboot has completed use a Run on RebootMore Information
MORE INFORMATION
For more information please see the following resources:
- Microsoft's DirectX homepage: http://www.microsoft.com/directx/
- Microsoft's DirectX support resources: http://support.microsoft.com/support/directx/
- DirectX Public newsgroups: news://msnews.microsoft.com/microsoft.public.directx
- Microsoft's MSDN DirectX homepage: http://msdn.microsoft.com/directx
- Command Reference | Actions | Individual Actions | IF in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | Read from Registry in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | END IF in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | Execute File in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | Run on Reboot in the Setup Factory 6.0 help file
KEYWORDS: Setup Factory 6.0, DirectX 8.1
Last reviewed: October 30, 2002
Copyright © 2002 Indigo Rose Corporation. All rights reserved.