1
votes

I have some custom actions in my installer. These are sequenced after InstallFinalize action.

I need to implement rollback for these custom actions.

As Far as i read, I can only implement rollback for custom actions sequenced between InstallInitialize and InstallFinalize.

Any way i can do it?

3
Just curious - what could it be that needs to happen after InstallFinalize, that also needs to be rolled back?Andreas
these custom actions are performing some registry operations. it's an old written installer so i was avoiding going into changing the sequences.KhannaKapil
I don't know if you can do it. But it sounds like you have the opportunity to execute the boy scout rule. There is a reason why it is called InstallFinalize. Nothing installer-ish should take place after. Maybe showing a text box or something.Andreas

3 Answers

1
votes

As you say, rollback applies only to the transaction part of the installation, which is between InstallInitialize and InstallFinalize. That is the install transaction and there is no rollback outside these boundaries. If you do something after InstallFinalize that fails, it's too late - the install is over. As has been said, don't put your CA there if you want rollback.

0
votes

Any custom action that changes the system sequenced after InstallFinalize is by definition an error in design. I would also be careful with custom actions that show messages and inspect the system. They should NOT return error codes at least, or a full rollback of the install might occur - this is particularly unfortunate for major upgrade scenarios (may leave two versions of a product registered, but only one installed).

Custom actions after InstallFinalize always fail in some contex which you cannot predict - often when the package is deployed via deployment system such as SCCM (SMS) or similar. Generally the custom actions after InstallFinalize are skipped or trigger unexpected rollbacks of the entire installation. They will also fail consistently when run without full administrator rights.

What kind of registry operations are you performing? They should be easy to implement in other ways.

0
votes

If your immediate mode custom action add registry data, I would remove them all and convert the registry data to be added by the registry table. This table features built-in support for advanced rollback and merging of registry keys and values. I think this is what you are asking.

When you have a product "in the wild" like you seem to have, I would recommend that you run the major upgrade with RemoveExistingProducts early in the InstallExecuteSequence and then install your new version with all immediate mode "change actions" gone. This should provide a smooth upgrade scenario, but makes patching difficult.