I'm writing a C++ function in a standard dll to delete files in a folder during uninstall. These files were added by the application at some point.
I'm using DeleteFile to delete the files one by one. The DeleteFile is returning an ERROR_ACCESS_DENIED error. The DeleteFile is called from the InstallShiel uninstall as a custom action during After InstallValidate when REMOVE="ALL".
Any ideas why I'm getting ERROR_ACCESS_DENIED? I'm uninstalling as an administrative user.
The InstallShield poject is a Basic MSI Project install. I'm using InstallShield Spring 2012 professional.
The Delete function works correctly when called from a normal test application (Windows Forms Application). The Dll is a Win32 dll.