If you are doing any coding in InstallScript and you want to use the DeleteDir function, you need to know one important fact.
DeleteDir is an InstallScript function that deletes a subdirectory. Here’s the syntax:
The flag can be any more of the following values:
- ALLCONTENTS – deletes the directory in szDir, including all subdirectories and files beneath it.
- ONLYDIR – deletes the directory in szDir only if it is empty.
- ROOT – deletes the directory in szDir even if it is the root directory.
If you have been using this function and it isn’t working, it’s probably because DeleteDir will not delete the current directory. Instead of calling the function by itself, call ChangeDirectory first to change the current directory to the C: drive or some other place.
szDir = INSTALLDIR ^ “Program”;