[wix-users] Custom actions: Correctly storing rollback data and cleaning up afterwards

Hoover, Jacob Jacob.Hoover at greenheck.com
Thu Nov 15 08:44:03 PST 2018


Or look at the wix source: \src\ext\ca\serverca\scasched\, search for rollback.



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Christopher Painter via wix-users
Sent: Wednesday, November 14, 2018 10:50 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Christopher Painter <chrpai at iswix.com>
Subject: Re: [wix-users] Custom actions: Correctly storing rollback data and cleaning up afterwards

Maybe this will help.

https://www.symantec.com/connect/blogs/windows-installers-rollback-script

Personally I store files in the TEMP directory and cleanup when done.

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Stephen Oberholtzer via wix-users
Sent: Wednesday, November 14, 2018 5:49 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Stephen Oberholtzer <stevie at qrpff.net>
Subject: [wix-users] Custom actions: Correctly storing rollback data and cleaning up afterwards

There are two problems I'm struggling with, both related to temporary storage required by custom actions.

Rollback data
===========
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 (
https://docs.microsoft.com/en-us/windows/desktop/msi/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?)




--
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.



More information about the wix-users mailing list