#include #include #include "debug.h" /* * this tool is run from the security profile cabs. * */ typedef enum { codeINSTALL_INIT_CONTINUE = 0, // @comm Continue with the installation codeINSTALL_INIT_CANCEL // @comm Immediately cancel the installation } codeINSTALL_INIT; typedef enum { codeINSTALL_EXIT_DONE = 0, // @comm Exit the installation successfully codeINSTALL_EXIT_UNINSTALL // @comm Uninstall the application before exiting the installation } codeINSTALL_EXIT; typedef enum { codeUNINSTALL_INIT_CONTINUE = 0, // @comm Continue with the uninstallation codeUNINSTALL_INIT_CANCEL // @comm Immediately cancel the uninstallation } codeUNINSTALL_INIT; typedef enum { codeUNINSTALL_EXIT_DONE = 0 // @comm Exit the uninstallation successfully } codeUNINSTALL_EXIT; #ifdef SETUPDLL_EXPORTS #define SETUPDLL_API extern "C" __declspec(dllexport) #else //#define SETUPDLL_API extern "C" __declspec(dllimport) #define SETUPDLL_API #endif BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { DebugMessagebox(); switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: debug("process attach"); break; case DLL_THREAD_ATTACH: debug("thread attach"); break; case DLL_THREAD_DETACH: debug("thread dettach"); break; case DLL_PROCESS_DETACH: debug("process dettach"); break; default: debug("dllmain called with %d", ul_reason_for_call); } return TRUE; } SETUPDLL_API codeINSTALL_INIT Install_Init( HWND hwndParent, BOOL fFirstCall, BOOL fPreviouslyInstalled, LPCTSTR pszInstallDir) { debug("Install_Init %08lx %d %d %ls", hwndParent, fFirstCall, fPreviouslyInstalled, pszInstallDir); return codeINSTALL_INIT_CONTINUE; } SETUPDLL_API codeINSTALL_EXIT Install_Exit( HWND hwndParent, LPCTSTR pszInstallDir, WORD cFailedDirs, WORD cFailedFiles, WORD cFailedRegKeys, WORD cFailedRegVals, WORD cFailedShortcuts) { debug("Install_Exit %08lx %ls %d %d %d %d %d", hwndParent, pszInstallDir, cFailedDirs, cFailedFiles, cFailedRegKeys, cFailedRegVals, cFailedShortcuts); return codeINSTALL_EXIT_DONE; } SETUPDLL_API codeUNINSTALL_INIT Uninstall_Init( HWND hwndParent, LPCTSTR pszInstallDir) { debug("Uninstall_Init %08lx %ls", hwndParent, pszInstallDir); return codeUNINSTALL_INIT_CONTINUE; } SETUPDLL_API codeUNINSTALL_EXIT Uninstall_Exit( HWND hwndParent) { debug("Uninstall_Exit %08lx %ls", hwndParent); return codeUNINSTALL_EXIT_DONE; }