[Windows Mobile Software Development] ajhvdb:
Hi,

I created a SetupDLL for uninstall and delete of folders and files. Most files are deleted automatic by the cab uninstaller but these files were created after install.

How to debug a SetupDLL?

The following items are not removed?

\\Program Files\\SleepSense

\\Program Files\\SleepSense\\Themes

\\Program Files\\SleepSense\\Themes\\Default

\\TEMP\\SleepSense.Log.txt"

Not always?:

\\Application Data\\SleepSense

My SetupDLL:

#include "stdafx.h"
#include <string>
using std::string;

// ----------------------------------------------------------
// Variables

#define MAX_LOADSTRING 100
#define MAX_KEY_LENGTH 250
#define MAX_VALUE_NAME 250

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
return TRUE;
}

// **************************************************************************
codeINSTALL_INIT Install_Init(
HWND hwndParent,
BOOL fFirstCall, // is this the first time this function is being called?
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir
)
{
return codeINSTALL_INIT_CONTINUE;
}

// **************************************************************************
codeINSTALL_EXIT Install_Exit(
HWND hwndParent,
LPCTSTR pszInstallDir, // final install directory
WORD cFailedDirs,
WORD cFailedFiles,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts
)
{
return codeINSTALL_EXIT_DONE;
}

// **************************************************************************
codeUNINSTALL_INIT Uninstall_Init(
HWND hwndParent,
LPCTSTR pszInstallDir
)
{
WIN32_FIND_DATA findfiledata;
HANDLE hfind;
TCHAR pszLanguageFile[250];
TCHAR pszThemeFile[250];
TCHAR pszSettingsFile[250];
TCHAR pszLogFile[250];

//Language
memset(pszLanguageFile,0,sizeof(pszLanguageFile));
wcscpy(pszLanguageFile,pszInstallDir);
wcscat(pszLanguageFile,TEXT("\\Language.xml"));
hfind = FindFirstFile(pszLanguageFile,&findfiledata);
if(hfind != INVALID_HANDLE_VALUE) //file exists
{
DeleteFile(pszLanguageFile);
}

//Theme.xml
memset(pszThemeFile,0,sizeof(pszThemeFile));
wcscpy(pszThemeFile,pszInstallDir);
wcscat(pszThemeFile,TEXT("\\Themes\\Default\\Theme.xml"));
hfind = FindFirstFile(pszThemeFile,&findfiledata);
if(hfind != INVALID_HANDLE_VALUE) //file exists
{
DeleteFile(pszThemeFile);
}

//Settings.xml
memset(pszSettingsFile,0,sizeof(pszSettingsFile));
wcscpy(pszSettingsFile,TEXT("\\Application Data\\SleepSense\\Settings.xml"));
hfind = FindFirstFile(pszSettingsFile,&findfiledata);
if(hfind != INVALID_HANDLE_VALUE) //file exists
{
DeleteFile(pszSettingsFile);
}

//Log
memset(pszLogFile,0,sizeof(pszSettingsFile));
wcscpy(pszLogFile,TEXT("\\TEMP\\SleepSense.Log.txt"));
hfind = FindFirstFile(pszLogFile,&findfiledata);
if(hfind != INVALID_HANDLE_VALUE) //file exists
{
DeleteFile(pszSettingsFile);
}
return codeUNINSTALL_INIT_CONTINUE;
}

// **************************************************************************
codeUNINSTALL_EXIT Uninstall_Exit(
HWND hwndParent
)
{
//Settings
RemoveDirectory(_T("\\Application Data\\SleepSense"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Themes\\Default"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Themes"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Resources"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Sounds\\Alarm"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Sounds\\WakeUp"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Sounds"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Backgrounds\\Alarm"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Backgrounds\\WakeUp"));
RemoveDirectory(_T("\\Program Files\\SleepSense\\Backgrounds"));
RemoveDirectory(_T("\\Program Files\\SleepSense"));

return codeUNINSTALL_EXIT_DONE;
}

Anyone with some tips?