Delete Folder?

Got a problem you cannot solve? Try here.
Post Reply
DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Delete Folder?

Post 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?
Chris Miller
Posts: 66
Joined: Fri Mar 09, 2007 9:46 am
Location: Albany, NY
Contact:

Post 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"
Chris Miller
[url=http://www.versatrans.com]Tyler Technologies[/url]
[url=http://anotherlab.rajapet.net]My blog[/url]
[url=http://www.linkedin.com/in/christophermiller]My LinkedIn profile[/url]
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply