0

I use Installshield 2010, a Basic MSI Project.

Is there a way to use RemoveFiles action to remove files from RemoveFile table after InstallFinalize?

I have some files included in installer's components. I use those files to configure other files and after InstallFinalize I want to remove them.

I read about RemoveFiles action and I have noticed that the action is running before InstallFiles.

Is possible to change that or recall the action? How?

Thanks for your time!

2 Answers2

0

No you cannot move the RemoveFiles action after InstallFinalize. As the MSDN documentation states, it must be scheduled before the InstallFiles action.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa371199(v=vs.85).aspx

I would recommend using a custom action to perform the cleanup.

Ciprian
  • 3,533
  • 1
  • 18
  • 22
  • a custom action like runing a batch file to delete files? I though I can use a predefined functionality if installshield has one... – Cristian Nicoleta Jan 23 '12 at 13:05
  • Yes, something like that. But you can do much more with a custom action: http://msdn.microsoft.com/en-us/library/windows/desktop/aa368066(v=vs.85).aspx – Ciprian Jan 23 '12 at 14:25
0

If you have temporary files that are only needed during the execution of the installer put them in the Support Files view not components view.

InstallShield has a table ( ISSetupFile ) and related custom actions that will extract these files to a temp directory and assign it to the [SUPPORTDIR] property. It will clean this up for you at the end of the install also.

That way you won't be fighting against MSI trying to get it to install and uninstall something during the install.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Also depending on what's being done when you "configure" the files their may be other ways of doing that in MSI with a simpler design. – Christopher Painter Jan 24 '12 at 01:24
  • Thanks Cristopher! I succesfuly use Support Files view and this solved my problem. I wanted to sign some files with a particulary certificate and make some changes in them with an external program, I don't think I can do that with simpler design. – Cristian Nicoleta Jan 24 '12 at 12:43
  • I'm concerned that you said certificate. Is this a sensitive file? Anyone with knowledge of MSI will be able to use Orca to extract the certificate from the ISSetupFile table. I don't know your whole story but you might want to reconsider how it's being done. Perhaps you factor this out of the installer and into an application first run situation. Perhaps a C++ EXE with an excrypted resource that get's extracted and deleted to better protect the file. – Christopher Painter Jan 24 '12 at 16:39