Deleting files after Apply Install

Got a problem you cannot solve? Try here.
epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Deleting files after Apply Install

Postby epohl » Thu Jan 11, 2007 1:20 pm

I have a question that must have a simple answer but I've looked around and I can't find it.

I have some "temporary" files that get installed via the normal process, and are dealt with after Apply Install (i.e. after the Windows Installer does its business). Once they are installed, I use non-Windows Installer commands or plug-ins to deal with them (Run Program and SQL Server plugin). However, once that's done, I'd like to delete those temp files cleanly. If I use the regular Delete Files command, I have to call Apply Install again. If I use Delete Files Recursively, it removes some directories that I don't want removed. What's the cleanest way to do this?

Thanks,

Eric

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Thu Jan 11, 2007 2:46 pm

Put the files in the $SUPPORTDIR$ and use them from there, everything in the $SUPPORTDIR$ get deleted recursively when the installer exits.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Postby epohl » Thu Jan 11, 2007 2:54 pm

Excellent! Thanks for the quick response.

A similar question, this time about uninstalling. If I want to delete log files and other files that might have been created by the application, calling "Delete Files" before calling Apply Uninstall doesn't seem to work; I suspect it's because Apply Uninstall is undoing all the things it did in the msi install and nothing more. Again, Delete Files Recursive is a bit heavyhanded to use here. What do you suggest?

Thanks,

Eric

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Thu Jan 11, 2007 2:57 pm

Call DLL Function kernel32.dll->DeleteFileA (get result into variable LASTERROR)

~InstallAware Clipboard Data~
~Call DLL Function~
~{19C3F358-47F9-4BF3-B6F6-E10D7C935EFB}~
~kernel32.dll,DeleteFileA,bool,LASTERROR,"pointer to string",$TARGETDIR$\\mylogfile.txt,$~
~mIDEFunc.dll\\mEXEFunc.dll~

Paste that in your MSICode and edit accordingly.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 140 guests