Page 1 of 1

delete file at the time terminate install

Posted: Wed May 07, 2008 8:00 am
by ponnuraj
Hi,

In my application, i need to delete a text file, at the time of terminating installation. is it possible to delete a file, before the terminate install command.

Can anyone give me the procedure to do this?

Thanks in advance.

Regards,
Raj

Posted: Mon May 19, 2008 7:52 pm
by CandiceJones
Sure, Raj. Just call DeleteFileA in kernel32.dll using Call DLL Function. Since the Windows Installer stage is over at that point, you need to directly call the Win32 API for the deletion to succeed.

If you're looking for a way to make files available temporarily while setup is running (without having to install them permanently), take a look at the File Bag function or the Support Files/Creatives mechanism.