ProgrammingChapter —7
236 700Series Color MobileComputer User’s Manual
UsingInstallation Functions in SETUP.DLLSETUP.DLL is an optionalfile that enables you to perform custom opera-
tions during installation and removal of your application. T he following
list shows the functions that are exported by SETUP.DLL.
Install_Init Called beforeins tallationbegins. Use this function to check the application version when reinstal-
ling an applicationand to determine if a dependent application is present.
Install_Exit Called after installationis complete. Use this function to handle errors that occur during applica-
tionins tallation.
Uninstall_Init Calledbefore the removal process begins. Use this function to closethe application, if the applica-
tion is running.
Uninstall_Exit Calledafter the removal process is complete. Use this function to save database information to a
fileand delete the database and to tellthe user where the user data files are stored and how torein -
stall the application.
Note;Use[DefaultInstall] >CESelfRegister(page 228) in the .INF file to
point toSETUP.DLL.
Afterthe CAB File ExtractionCab files that need to cause a warm reset after cab extractionwill need to
create the __RESETMEPLEASE__.TXT file in the “\Windows” directory.
The preferred methodto create this file is within the DllMain portion of
theSETUP.DLLfile.Itlookslikethis:
#include <windows.h>
#include <Tlhelp32.h>
#include <winioctl.h>
#include <ce_setup.h> // in the public SDK dir
#define IOCTL_TERMINAL_RESET CTL_CODE (FILE_DEVICE_UNKNOWN,FILE_ANY_ACCESS,
2050, METHOD_NEITHER)
BOOL APIENTRY DllMain( HANDLE h, DWORD reason, LPVOID lpReserved )
{return TRUE;
} // DllMain
//************************************************************************
// $DOCBEGIN$
// BOOL IsProcessRunning( TCHAR * pname );
//
// Description: Get process table snapshot, look for pname running.
//
// Arguments: pname - pointer to name of program to look for.
// for example, app.exe.
//
// Returns: TRUE - process is running.
// FALSE - process is not running.
// $DOCEND$
//************************************************************************
BOOL IsProcessRunning( TCHAR * pname )
{HANDLE hProcList;