A) The installation package's content

The installation package comprises two files: NGSetup.DLL and NGSetup.DAT. NGSetup.DLL is the exectuable dynamic linking library for installing middleware. NGSetup.DAT is the resource file for installing and uninstalling middleware.

B) APIs in dll

Interfaces 

There are four functions, which could be called to complete a single operation. Their interface's definition are listed below:

1) DWORD WINAPI instMW_Install(const char* szParam);
2) DWORD WINAPI instMW_Uninstall(const char* szParam);
3) DWORD WINAPI instMW_IsHaveInstalled(const char* szParam);
4) DWORD WINAPI instMW_IsNeedReboot(void);

C) Instruction to parameters in API interfaces

1) instMW_Install receives a string describing the resource file's name as parameter (i.e. "NGSetup.DAT"), or an empty pointer. If the parameter is an empty pointer, function uses the same name as dll's name. (for example, calling NGSetup.DLL's instMW_Install interface and using an empty pointer as parameter, function will use NGSetup.DAT as resource file's name
2) instMW_Uninstall similar to 1)
3) instMW_IsHaveInstalled similar to 1)
4) instMW_IsNeedReboot no parameter required

D) Result value's definition

1) For instMW_Install and instMW_Uninstall interfaces' result value

#define ESA_SUCCESS			0x0000 //Success
#define ESA_ERR_FILE_NOT_FOUND		0x0001 //Can not find file
#define ESA_ERR_COPY_FILES		0x0002 //Copying file failed
#define ESA_ERR_REG			0x0003 //Registering file or activating file failed
#define ESA_ERR_REG_CSP			0x0004 //Registering CSP failed
#define ESA_ERR_UNREG			0x0005 //Unregistering CSP failed
#define ESA_ERR_DEL_FILES		0x0006 //Deleting file failed
#define ESA_ERR_DEL_DIR			0x0007 //Deleting firectory failed
#define ESA_ERR_EXCTOR_FILES		0x0008 //Unpacking resource file into temp folder failed
#define ESA_ERR_HOST_MEMORY		0x0009 //Memory error
#define ESA_ERR_REG_CARD_REG		0x000A //Installing driver failed
#define ESA_ERR_PRODUCT_ALD_INST	0x000B //The package has been installed, user must uninstall the old package before a new installation
#define ESA_ERR_NEEDREBOOT		0x000C //System needs to be restarted before installing or uninstalling

2) For instMW_IsHaveInstalled interface's result value

#define ESA_NEVER_INSTALL		0 //Product has not been installed
#define ESA_DEST_DVERSION_OLD		1 //Product has been installed and is order than current package
#define ESA_DEST_DVERSION_EQUAL		2 //Product has been installed and is the same as current package
#define ESA_DEST_DVERSION_NEW		3 //Product has been installed and is newer than current package

3) For instMW_IsNeedReboot interface's result value
1 means system needs to be restarted.
0 means system does not need to be restarted.

CAUTION: it needs NGSetup.dat, NGSetup.dll, NGSetup.lib files in the folder "Lib\setup\"


