cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Removing a file and its path during uninstall

CChong
By Level 11 Flexeran
Level 11 Flexeran
I am using a custom action to call an executible and place a file in my installation directory. On uninstall, this custom action is not run (by design).

As it is now, the file is left with the installdir after uninstall. i.e.

"C:\Program Files\Company\Product\Bin\myfile.jim"

I need this file, and the install dir to be removed when the uninstall is run. Any Ideas?

Scandler
(6) Replies
You could create a custom action which removes the file during uninstall.
CChong
By Level 11 Flexeran
Level 11 Flexeran
That would be good....but how do I ensure it only runs during uninstall...
For information about ensuring a custom action runs only during uninstall, please see this earlier thread: http://community.installshield.com/showthread.php?s=&threadid=110048.

An advanced technique is to populate a row in the RemoveFile table of your MSI database (using, for example, Developer's Direct Editor view); this doesn't require a custom action. For information about the RemoveFile table, see the MSI Help Library.
CChong
By Level 11 Flexeran
Level 11 Flexeran
Robert,
I liked the idea of doing the direct edit, and tried to do it, but couldn't seem to get the table entries correct in the remove section. Could you provide some insight using the example above? Remember, this file is installed via a custom action that calls an exe to place the file.

Thanks,

Scandler
For example, if the file is being installed to INSTALLDIR, you might add the following to the RemoveFile table:

  • FileKey: RemoveFile1 (an arbitrary key)
  • Component_: main_component (pick a component)
  • FileName: myfile.jim
  • DirProperty: INSTALLDIR (file loc. as directory identifier)
  • InstallMode: 2 (remove on uninstall)
CChong
By Level 11 Flexeran
Level 11 Flexeran
Thanks!

Clarification of the fields is what I REALLY needed!

Thanks,

Scandler