Copyright: ® Microsoft Corporation


DirectSetup Help Contents (V1.0)
Table Of Contents

DirectSetup

About DirectSetup

Using DirectSetup

DirectSetup API

API


About DirectSetup

DirectSetup is a simple API that provides the developer with a "one call" installation for the DirectX components.  This is more that a convenience, as DirectX is a complex product and its installation is an involved task.  The developer should not attempt a "manual" installation of DirectX.


Using DirectSetup

Although there are actually two APIs provided by DirectSetup, only one is of use to the typical game developer.  The other is directed towards those who will be installing their own DirectX device drivers, and is not addressed in this document.

Although DirectSetup allows you to install a single DirectX component, such as DirectDraw, this is not recommended as the space savings is minimal due to interdependencies between the DirectX components.


API

There are only two functions provided by DirectSetup, and only one of them, DirectXSetup, is of interest to the typical game developer.  The other, DirectXDeviceSetup, is intended for the use of manufacturers wishing to install their own DirectX device drivers and is not addressed in this document.  The declarations for DirectSetup can be found in DSETUP.H.

See:

DirectXSetup


DirectXSetup

Install one or more DirectX components.

int WINAPI DirectXSetup(

HWND hwnd,

LPSTR root_path,

DWORD flags )

Parameters

hwnd

Parent HWND for the setup dialog boxes.

root_path

Pointer to a string containing the root path of the DirectX component files.

flags

One or more flags to indicate which DirectX components should be installed.  A full installation is recommended.

DSETUP_DDRAW	Install DirectDraw
DSETUP_DSOUND	Install DirectSound
DSETUP_DPLAY	Install DirectPlay
DSETUP_DIRECTX	Install all DirectX components
DSETUP_REINSTALL	Install even if the existing components are the same version.
Return Values

SUCCESS

0 if the setup was successful and no reboot is required.

1 if the setup was successful and a reboot is required.

DSETUPERR_BADWINDOWSVERSION

The version of Windows on the user's system is not supported by DirectX.

DSETUPERR_SOURCEFILENOTFOUND

One of the required source files could not be found.

DSETUPERR_BADSOURCESIZE

A file's size could not be verified or was incorrect.

DSETUPERR_BADSOURCETIME

A file's date and time could not be verified or was incorrect.

DSETUPERR_NOCOPY

A file's version could not be verified or was incorrect. If the DSETUP_REINSTALL flag is specified, equal versions will be installed..

DSETUPERR_CANTFINDINF

A required INF file could not be found.

DSETUPERR_OUTOFDISKSPACE

Setup ran out of disk space during the installation.

DSETUPERR_CANTFINDDIR

Setup could not find the working directory.

DSETUPERR_INTERNAL

Internal error.