Page 1 of 1

Delete Folder?

Posted: Tue Jul 28, 2009 2:44 pm
by DanStutzman
Did I just discover that there is no way to delete an existing folder within InstallAware? How did that fall through the cracks?

Posted: Tue Jul 28, 2009 4:03 pm
by Chris Miller
Can you do something like this with the "Run Program" MSIcode command:

Code: Select all

Run Program cmd.exe /c rmdir /s /q "c:\\somefolder"

Posted: Tue Jul 28, 2009 4:20 pm
by MichaelNesmith
Another implementation would be using Call DLL Function on the RemoveDirectoryA WinAPI call in kernel32.dll. Returns a BOOL, the single parameter that specifies the folder location is a LPCTSTR.

Call Delete Files Recursive first if the folder is not empty.