- Introduction
- Part 1 - Creating a Windows Installer .dll
- Part 2 - Calling the Windows Installer .dll from a setup
- Part 3 - Debugging a Windows Installer .dll
- Project Type: MFC DLL
- DLL Type: Regular DLL with MFC statically linked
- Name: CustomActions
I always recommend static linking for Windows Installer Dlls – Typically the Dll will be streamed from the .msi to the %temp% folder, and called from there. Statically linking helps ensure everything you need is contained in one dll.
#include <MsiQuery.h> //Windows Installer API
#include <Msi.h>
/* MyFunction **************************************
Args: [in] MSIHANDLE hMsi
- handle to running install (passed by the Windows Installer)
Desc: Example
************************************************************/
UINT __stdcall MyFunction(MSIHANDLE hMsi)
{
return ERROR_SUCCESS;
}
; CustomActions.def : Declares the module parameters for the DLL.
LIBRARY "CustomActions"
EXPORTS
; Explicit exports can go here
MyFunction
The next step is adding the .dll to your setup project, which is covered in Part 2.