Is there a way to remove the ENTIRE TARGETDIR when uninstalling an application.
In this case it is a MATLAB application, which creates all sorts of subdirectories under the installation directory when you run it the first time.
I want to be able to completely remove the directory tree, otherwise all sorts of files will get left behind,
Removing everything from the TARGETDIR on uninstall
-
Gareth Owen
- Posts: 149
- Joined: Fri Oct 21, 2005 8:42 am
- Location: UK
As I think you already know, the Delete Files command is available, but it deletes single level folders only.
You may want to try the Find All Files command and code a loop which processes each found file and calls the DeleteFileA Win32 API in kernel32.dll directly with Call DLL Function...I hope that helps.
You may want to try the Find All Files command and code a loop which processes each found file and calls the DeleteFileA Win32 API in kernel32.dll directly with Call DLL Function...I hope that helps.
-
Gareth Owen
- Posts: 149
- Joined: Fri Oct 21, 2005 8:42 am
- Location: UK
I looked at this script as I am having a similar problem.
Issue is, you cannot use labels inside a condition block, so says the InstallAware compiler. Which means this mia script won't work for code in the uninstall condition block.
All I want to do is the equiv of:
rmdir /S /Q $PATH$
Any ideas?
Issue is, you cannot use labels inside a condition block, so says the InstallAware compiler. Which means this mia script won't work for code in the uninstall condition block.
All I want to do is the equiv of:
rmdir /S /Q $PATH$
Any ideas?
---
Regards,
Dana Epp
Regards,
Dana Epp
After talking with Sinan a bit, it looks like there is a way around this.
His script works fine. The problem is you can't place it in the REMOVE condition block during uninstall.
My solution was to place a condition check near the end of the file that basically is:
Then add a new Label of "End Delete Files" at the end of the code in Sinan's original mia script. Walla. It all works as expected.
Thanks for the sample code and the idea for a work around for the conditional block issue Sinan. Much appreciated.[/code]
His script works fine. The problem is you can't place it in the REMOVE condition block during uninstall.
My solution was to place a condition check near the end of the file that basically is:
Code: Select all
if Variable REMOVE not Equals TRUE
GoTo Label: End Delete Files
endThanks for the sample code and the idea for a work around for the conditional block issue Sinan. Much appreciated.[/code]
---
Regards,
Dana Epp
Regards,
Dana Epp
-
[email protected]
- Posts: 10
- Joined: Thu Aug 19, 2010 4:47 pm
Re: Removing everything from the TARGETDIR on uninstall
I need to accomplish the same task. The script mentioned seems to be missing, any updates?
I also need to delete file from the "Common Application Data" folder upon install. I expect that I can use the same logic in the script to accomplish this task as well.
Any help given is appreciated,
Steve
I also need to delete file from the "Common Application Data" folder upon install. I expect that I can use the same logic in the script to accomplish this task as well.
Any help given is appreciated,
Steve
Re: Removing everything from the TARGETDIR on uninstall
Try the command Delete Files Recursive.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
-
[email protected]
- Posts: 10
- Joined: Thu Aug 19, 2010 4:47 pm
Re: Removing everything from the TARGETDIR on uninstall
Thanks - it worked to delete all of the files, and as advertised it didn't delete the folder. I do want the folder deleted though. How is that accomplished?
Thanks,
Steve
Thanks,
Steve
Re: Removing everything from the TARGETDIR on uninstall
There are a couple of ways described here:
http://www.installaware.com/forum/viewt ... 1e3de71a9b
http://www.installaware.com/forum/viewt ... 1e3de71a9b
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

