WIX installer. Undo the custom action for the custom action that followed installFinalize

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

I need to roll back for these user actions.

Until I read, I can only roll back for custom actions ordered between InstallInitialize and InstallFinalize.

Anyway, can I do this?

+1
source share
3 answers

As you say, rollback only applies to the transactional part of the installation, which is between InstallInitialize and InstallFinalize. This is an installation transaction, and there is no rollback beyond these boundaries. If you do something after InstallFinalize completes, it's too late - the installation is complete. As already mentioned, do not do your CA there if you want a rollback.

+1
source

Any custom action that changes the system after installing InstallFinalize is, by definition, a design error . I would also be careful with user actions that show messages and check the system. They should not return error codes at least, or a complete rollback of the installation may occur - this is especially unsuccessful for the main upgrade scenarios (it may leave two versions of a registered product, but only one is installed).

Custom actions after InstallFinalize always fail in some contexts that you cannot predict โ€” often when a package is deployed through a deployment system such as SCCM (SMS) or similar. Typically, user actions after InstallFinalize are skipped or trigger unexpected rollbacks of the entire installation. They will also work without failures at startup without full administrator rights.

What registry operations do you perform? They should be easily implemented in other ways.

0
source

If registry data is added in an immediate user action, I delete all of them and convert the registry data that will be added to the registry table. This table contains built-in support for extended rollback and merging of registry keys and values. I think this is what you are asking for.

When you have a product in the wild, as if you had one, I would recommend that you start the main update with RemoveExistingProducts at an early stage of InstallExecuteSequence, and then install the new version with all the immediate โ€œchangesโ€. This should provide a smooth upgrade scenario, but it is difficult to fix.

0
source

Source: https://habr.com/ru/post/957095/


All Articles