PDA

View Full Version : HOWTO: Add DirectX 8.1 Support to your Setup Factory 6.0 Installation



Support
10-30-2002, 02:55 PM
<HTML><HEAD><TITLE>HOWTO: Add DirectX 8.1 Support to your Setup Factory 6.0 Installation</TITLE></HEAD><BODY><h3>HOWTO: Add DirectX 8.1 Support to your Setup Factory 6.0 Installation</h3><b>Document ID: IR04043</b><hr>The information in this article applies to:<ul><li>Setup Factory 6.0</li></ul><hr><h3>SUMMARY</h3><p>This document provides instructions for adding DirectX 8.1 support to your Setup Factory 6.0 installation.</p><h3>DISCUSSION</h3><p>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)</p><p>DX81Redist.exe can be downloaded from: <A HREF="http://msdn.microsoft.com/directx" target="blank">http://msdn.microsoft.com/directx</a></p><p>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:</p><pre><code>...\Setup Factory 6.0\Runtimes\DirectX81\</code></pre><p>This will place all the files you need to distribute in the following directory:</p><pre><code>...\Setup Factory 6.0\Runtimes\DirectX81\Redist\DirectX81</code></pre><p><b>Note:</b> 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: </p><pre><code>...\Setup Factory 6.0\Runtimes\DirectX81\</code></pre><p><b>Compatibility Information</b></p><p>DirectX 8.1 is designed for the following Windows Operating Systems: Windows 98, ME, and 2000.</p><p><b>Windows XP:</b> DirectX 8.1 is the version of Direct X that ships with Windows XP, therefore no installation is necessary.</p><p><b>Windows 95:</b> DirectX 8.1 is not supported on Windows 95. However, DirectX 8.0a is supported on Windows 95, the download can be found here: <A HREF="http://www.microsoft.com/directx/homeuser/downloads/default.asp" target="blank">http://www.microsoft.com/directx/homeuser/downloads/default.asp</a></p><p><b>Windows NT 4.0:</b> 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: <A HREF="http://www.microsoft.com/directx/homeuser/downloads/default.asp" target="blank">http://www.microsoft.com/directx/homeuser/downloads/default.asp</a></p><p><b>Developer Notes</b></p><p>This document will explain how to distribute DirectX 8.1 via CD-ROM.</p><p>After following the steps outlined in the Necessary Configuration section you should have the following files located in your <code>...\Setup Factory 6.0\Runtimes\DirectX81\Redist\DirectX81</code> directory:</p><pre><code>BDA.cab<br>BDANT.cab<br>cfgmgr32.dll<br>DirectX.cab<br>DSETUP.dll<br>dsetup32.dll<br>dxnt.cab<br>dxsetup.exe<br>setupapi.dll </code></pre><p>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:</p><ul><li>...\DirectX81\BDA.cab</li> <li>...\DirectX81\BDANT.cab</li> <li>...\DirectX81\cfgmgr32.dll</li> <li>...\DirectX81\DirectX.cab</li> <li>...\DirectX81\DSETUP.dll</li> <li>...\DirectX81\dsetup32.dll</li> <li>...\DirectX81\dxnt.cab</li> <li>...\DirectX81\dxsetup.exe</li> <li>...\DirectX81\setupapi.dll</li> </ul><p>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.</p><p>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 <i>Actions</i> dialog. You can acess this dialog from the menu under: <b>Design | Actions</b>.</p><p>The first thing to do is check if the current user has a compatible operating system, so we will add an <b>IF</b> control structure. We will make the <b>IF</b> condition as follows:</p><pre><code>(!%IsWin95%) AND (!%IsWinNT4%) AND (!%IsWinNT3%) AND (!%IsWinXP%)</code></pre><p>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.</p><p>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 <b>Read From Registry</b> action, directly after the <b>If</b> control structure.</p><p>The Read From Registry action will look like this:</p><pre><code><b>Variable Name:</b> %DXVersion%<br><b>Default Value:</b> 0.0.0<br><b>Main Key:</b> HKEY_LOCAL_MACHINE<br><b>Sub Key:</b> Software\Microsoft\DirectX<br><b>Value Name:</b> Version<br><b>Set "Variable" to True if key exists:</b> Unchecked<br><b>Auto-expand if value is of type REG_EXPAND_SZ:</b> Unchecked</code></pre><p>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 <b>IF</b> condition:</p><pre><code>(%DXVersion% < 4.08.01.0881)</code></pre><p>This translates to: If "the user's DirectX version is less than the version we are going to install" then continue.</p><p>The next action will be the execution of the DirectX 8.1 installation using an <b>Execute File</b> action. Given the directory structure discussed above, our <b>Execute File</b> action will look like this:</p><pre><code><b>File to execute:</b> %SrcDrv%\DirectX81\dxsetup.exe<br><b>Command line arguments:</b><br><b>Working directory:</b><br><b>Run Mode:</b> Normal<br><b>Wait for program to finish running before continuing:</b> Unchecked</code></pre><p>This <b>Execute File</b> action will execute the DirectX 8.1 installation that is found on your CD-ROM. </p><p><b>Note:</b> The built-in variable %SrcDrv% is used in the action. It will be expanded, at runtime, to be the root of your CD-ROM.</p><p>In the end your action list will look something like this:</p><pre><code>If ((!%IsWin95%) AND (!%IsWinNT4%) AND (!%IsWinNT3%) AND (!%IsWinXP%))<br> Read from Registry(%DXVersion% = HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\Vers ion)<br> If (%DXVersion% < 4.08.01.0881)<br> Execute(%SrcDrv%\DirectX81\dxsetup.exe)<br> END IF<br>END IF</code></pre><p>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.</p><p>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.</p><p><b>Note:</b> 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 <b>Run on Reboot</b action.</p>More Information<h3>MORE INFORMATION</h3><p>For more information please see the following resources:</p><ul><li>Microsoft's DirectX homepage: <A HREF="http://www.microsoft.com/directx/" target="blank">http://www.microsoft.com/directx/</a></li><li>Microsoft's DirectX support resources: <A HREF="http://support.microsoft.com/support/directx/" target="blank">http://support.microsoft.com/support/directx/</a></li><li>DirectX Public newsgroups: <A HREF="news://msnews.microsoft.com/microsoft.public.directx" target="blank">news://msnews.microsoft.com/microsoft.public.directx</a></li><li>Microsoft's MSDN DirectX homepage: <A HREF="http://msdn.microsoft.com/directx" target="blank">http://msdn.microsoft.com/directx</a></li><li><b>Command Reference | Actions | Individual Actions | IF</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | Read from Registry</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | END IF</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | Execute File</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | Run on Reboot</b> in the Setup Factory 6.0 help file</li></ul><p>KEYWORDS: Setup Factory 6.0, DirectX 8.1</p><hr><FONT SIZE=1>Last reviewed: October 30, 2002<br>Copyright 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>