Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

DeleteDir will not remove the directories


4 replies to this topic

SubDir

SubDir
  • Members
  • 19 posts

Posted 05 August 2002 - 18:58

I want to remove the directories in is5.5, but it does't work.
I use the commands:
SetFileInfo(sPath, FILE_ATTRIBUTE, FILE_ATTR_SYSTEM, sNULL);
and
DeleteDir ( sPath , ALLCONTENTS );
but the directory still exists.
I also use the command DeleteDir twice.

What can I do to delete the directories? They are empty.

Thanks for help.

EberhardH

EberhardH
  • Members
  • 137 posts

Posted 06 August 2002 - 12:41

Hi,

one reason may be:
if you happened to use FindAllFiles(...) before to browse through a directory, you cannot remove this directory unless you "released" it: call FindAllFiles again but now with CANCEL as last parameter. Now, the directory is removable with DeleteDir(...).

Another reason:
you changed to this directory and stand just in it. Change to a different directory then and remove it afterwards.

Eberhard

SubDir

SubDir
  • Members
  • 19 posts

Posted 06 August 2002 - 16:00

Thanks, but I have tried this and it don't works.


By the way, I have found the reason why I can not delete the directories:

The directories are already in use from a dll which the installation starts, but I haven't the source to this.

Can I resolve this problem?

EberhardH

EberhardH
  • Members
  • 137 posts

Posted 07 August 2002 - 06:21

Apparently not.

As long as a DLL locks a directory, the only way to free it is to kill the DLL (DLL as a process).

Can't you delete the directory prior to running the DLL?

Eberhard

SubDir

SubDir
  • Members
  • 19 posts

Posted 09 August 2002 - 08:16

I will dissolve it with developping a new DLL with the same function.