[wix-users] Custom actions: Correctly storing rollback data and cleaning up afterwards
stevie at qrpff.net
Wed Nov 14 15:48:39 PST 2018
There are two problems I'm struggling with, both related to temporary
storage required by custom actions.
I've found several articles online explaining how to use rollback (and
sometimes even commit) custom actions, but I've not found *any* trustworthy
examples of how to actually store the data needed to perform a rollback.
The most obvious solution is to use some sort of temporary storage, most
likely a file. But I haven't found *any* documentation on where to find
acceptable temporary storage for rollback data. The MSDN article for
Rollback Custom Actions (
simply says that the installer uses a "hidden system directory" to store
backups for rollback - not where to find that directory, despite the fact
that the very existence of that page is evidence that someone might need it!
Temporary storage for immediate actions
I found myself in a rather unenviable position: Due to authoring errors in
the MSIs that were published for older versions, the RemoveExistingProducts
step could cause certain files to deleted when they should not be -- either
due to a malfunctioning custom action run at uninstall, or due to a
component that should have been marked as Permanent, but wasn't.
The solution to that seems obvious -- save the file off somewhere before
RemoveExistingProducts, and restore it afterwards. This situation carries
with it *two* problems, however:
1. The same problem as rollback data -- where do we save the file to?
2. How can I ensure that any temporary storage is cleaned up if the
installation is aborted (e.g. user hits Cancel?)
Real programmers use COPY CON PROGRAM.EXE
More information about the wix-users