In article <49a75c79.5030...@tait.co.nz>,
    Joe Osman <joe.os...@tait.co.nz>  writes:

> I want to run a custom action at the end of a rollback of product 
> upgrade. This custom action will change the logon password of an 
> installed service so it should be executed at the end of the rollback 
> after the service from the previous install is rolled back.

OK, so let me see if I have this straight:

1) You're doing a major upgrade and you have RemoveExistingProducts
sequenced at the start of your install transaction.  This means the
old product is removed and then the new product is installed.

2) During a failed upgrade, the install of the new product is rolled
back and then the uninstall of the old product is rolled back.

3) The rollback of the uninstall of the previous version somehow
resets the password of the service that it restored.

4) You want to reset the password appropriately after the service is
restored.

Now, assuming all of that is correct, here's how I would approach it:

1) Patch the existing version so that when it rolls back an uninstall it
restores the password.

2) Apply the patch before you upgrade via a bootstrapper or a
LaunchCondition in the new version.

Why do I say patch the existing version?  Because its the right place
for the rollback to occur.  Its the restoration of the uninstalled
service that's messing up the password.  Its the piece of the puzzle
that's at fault, so its the piece that needs to be fixed.

You can't put it in the new product because RemoveExistingProducts
must appear *first* in the install transaction.  Therefore you can't
place a rollback action in the transaction before
RemoveExistingProducts.  Because you can only schedule rollback CAs
after RemoveExistingProducts runs, it means that those rollback CAs
will execute before the previous version is rolled back.  In other
words, a rollback of an upgrade with RemoveExistingProducts at the
start of the install transaction looks like this:

        - Rollback installation of new product
        - Rollback uninstallation of existing products

There isn't a way to get another rollback CA from the new package
scheduled to run after the existing products have been restored.

Now you could try moving RemoveExistingProducts to the end of the
install transaction.  That would mean that your rollback would look
like this:

        - Rollback uninstallation of existing products
        - Rollback installation of new product

However, when I implemented a large upgrade, I had so many problems
(to be fair, they came from the way our installation was implemented,
not from the core Windows Installer runtime) with
RemoveExistingProducts at the end of the install transaction, that I
gave up and moved it to the start of the transaction where everything
was happy.  So, I don't have any good personal experience with putting
RemoveExistingProducts at the end of the install transaction and no
experience with how this behaves during a rollback.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
      <http://www.xmission.com/~legalize/book/download/index.html>

        Legalize Adulthood! <http://blogs.xmission.com/legalize/>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to