Writing an Installation DLL

You can provide one or two installation DLLs. These DLLs can be the same DLL with two different entry points or two different DLLs with corresponding entry points. There are two ways to call an installation DLL:

The parameters for each entry point are as follows:

HWND (input)

PSZ (input) PSZ (input) PSZ (input) HWND (input) PSZ (output)

The following is an example prototype used to define an installation DLL.

ULONG APIENTRY StartMyInstall (HWND hwndOwnerHandle,                               PSZ pszSourcePath,
                               PSZ pszTargetDrive,
                               PSZ pszMyParms,
                               HWND hwndMinstallHandle,
                               PSZ pszResponseFile);

MINSTALL provides numerous services to the installation DLLs due to the various environments in which MINSTALL must operate. You can use MINSTALL on a machine that has never had OS/2 multimedia installed on it. You can also use MINSTALL on a machine that has OS/2 multimedia installed on the hard drive. OS/2 multimedia does not need to be running to use MINSTALL in this environment. MINSTALL retains control of the MMPM2.INI and CONFIG.SYS files to ensure no changes are made to these files while MINSTALL is running.

While MINSTALL has control of the MMPM2.INI and CONFIG.SYS files it might be necessary for an installation DLL to read or write to one or both of these files. MINSTALL provides an interface to allow the installation DLLs access to both the MMPM2.INI and CONFIG.SYS files. Also, if OS/2 multimedia is installed and running, some files might be open that MINSTALL attempts to replace. When this occurs, MINSTALL copies the open files to a temporary directory until the next system restart.

The following table lists the messages, along with the message formats and descriptions, available to an installation DLL. An installation DLL can send these messages with WinSendMsg or WinPostMsg.

Message

IM_CODEC1INSTALL
mp1 = 0;                               /* Not used */
mp2 = MPFROMP(PINSTCODECINIFILEINFO);  /* Pointer to the
                                          INSTIOPROC structure */

IM_CODEC2INSTALL

mp1 = 0;                                /* Not used */
mp2 = MPFROMP (PINSTCODECINIFILEINFO);  /* Pointer to the
                                           INSTIOPROC structure */

IM_CONFIGDELETE

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CONFIGENUMERATE

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CONFIGMERGE

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CONFIGNEW

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CONFIGQUERYCHANGED

mp1 = 0;  /* Not used */
mp2 = 0;  /* Not used */

IM_CONFIGREPLACE

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CONFIGUPDATE

mp1 = MPFROMP(PCONFIGDATA); /* Pointer to the CONFIGDATA structure */
mp2 = 0;                    /* Not used */

IM_CREATE_WPS_OBJECT

mp1 = 0;                        /* Not used */
mp2 = MPFROMP(PINSTOBJECTDATA); /* Pointer to the
                                   INSTOBJECTDATA structure */

IM_DESTROY_WPS_OBJECT

mp1 = 0;                /* Not used */
mp2 = MPFROMP(HOBJECT); /* This must be the exact OBJECTID
                           with which the object was created  */

IM_EA_JOIN

mp1 = 0;                    /* Not used */mp2 = MPFROMP(PINSTEAJOIN); /* Pointer to the INSTEAJOIN
                               structure */

IM_EA_LONG_NAME_JOIN

mp1 = 0;                            /* Not used */mp2 = MPFROMP(PINSTEALONGNAMEJOIN); /* A pointer to the structure
                                       that contains the long name
                                       as an ASCII string, the file or
                                       directory name to which the long
                                       name is to be applied, and the
                                       new EA name */

IM_LOG_ERROR

mp1 = MPFROMP((PSZ)pszStatement); /* The text of the message to insert
                                     at the end of the MINSTALL.LOG
                                     file */
mp2 = 0;                          /* Not used */

IM_MCI_EXTENDED_SYSINFO

mp1 = MPFROML(LONG);  /* The MCI_SYSINFO extended function desired */
mp2 = MPFROMP(*MCI_SYSINFO_PARMS); /* The SYSINFO
                                                      structure       */

IM_MCI_SEND_COMMAND

mp1 = 0;                            /* Not used */
mp2 = MPFROMP(PINSTMCISENDCOMMAND); /* Pointer to the INSTMCISENDCOMMAND
                                       structure */

IM_MIDIMAP_INSTALL

mp1 = 0;                            /* Not used */
mp2 = MPFROMP(PMIDIMAPINSTALLDATA); /* Pointer to the
                                       MIDIMAPINSTALLDATA structure */

IM_MMIO_INSTALL

mp1 = 0;                    /* Not used */
mp2 = MPFROMP(PINSTIOPROC); /* Pointer to the INSTIOPROC structure */

IM_QUERYPATH

mp1 = PMFROMP(PSZ); /* The name of the file needed  */
mp2 = PMFROMP(PSZ); /* The full path to the file    */

IM_SPI_INSTALL

mp1 = 0;            /* Not used */
mp2 = MPFROMP(PSZ); /* The fully qualified path of a SPI resource DLL */

The data structures used as parameters for the messages in the previous list are defined in the MINSTALL.H file located in the \TOOLKIT\H subdirectory.

Follow these guidelines when writing an installation DLL:


[Back: Defining Changes to Other INI Files]
[Next: Installing a Media Control Driver]