Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Delete files after use but during install


1 reply to this topic

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 17 January 2006 - 19:01

I'm altering an MSI for a client to run a bunch of SQL files with OSQL. That's easy, already done it. What I can't remember is how to delete the SQL files after they've been used. The client isn't worried about whether or not the SQL actually worked (there's confidence for you...) but is paranoid about leaving these files around.

Please, no responses about SQL security, etc: the client wants them deleted so I want to delete them.

I'm guessing the entries need to go in the RemoveFile table but how do I arrange that they're only removed after the CA which uses them has been run?

For the time being I'm using an embedded VBScript CA which works well, but I'm sure there has to be a native, MSI way. I've been scripting for so long, it's become an automatic choice for me smile.gif
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 19 January 2006 - 02:02

The Remove file table will remove the files listed when it hits the "RemoveFiles" action.

I would keep the file deletion in the custom action.

If you want to remove the file using the remove file table, you would have to:

Add the file to the remove file table
Schedule your custom action to run before the RemoveFiles action

Bare in mind that this will remove the file on all installs, assuming you set the remove file table entry to remove on install. If you want to condition this, you would have to modify the components condition that you are using for the remove file table entry dynamically in the custom action by using a property.