Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

MSI transactions questions


3 replies to this topic

elliot

elliot
  • Full Members
  • 28 posts

Posted 30 December 2009 - 10:58

Hello all,

I want to start using MSI Transactions to perform several installations as a single transaction of windows installer.

I have read some documentation about this issue. However, several issues are not fully clear to me:

1) Can I make an un-installation of several MSIs in a single transaction by sending for each of the calls of MsiInstallProduct the property REMOVE=ALL? logically - this will do the work (am I right?), however - how does the MSI transaction behave in case one of the MSIs failed to be removed (or was canceled) and I "ask" the windows installer service to roll-back the whole transaction at the end?

2) How does the transaction results in case of several major upgrades which are performed as a single transaction? what if one of the upgrades fail? will the roll-back work here as well as in an new installation on a clean machine (bring all the products to the state of prior of the upgrade)?


Thank you in advance

E.



akerl

akerl
  • Full Members
  • 104 posts

Posted 30 December 2009 - 11:20

As generic you must start the multi package transaction by MsiBeginTransaction(). After this call you can uninstall the products by MsiInstallProduct( ... REMOVE=ALL ...). You must check the return code of the MsiInstallProduct() call and in addiction to the result youcan commit or rollback the transaction.

Additional Infos: http://blogs.msdn.co...ransaction.aspx

LG
Andreas

Andreas Kerl

Inside Windows Installer 4.5
ISBN 3-86645-431-7


elliot

elliot
  • Full Members
  • 28 posts

Posted 30 December 2009 - 11:54

Hello Andreas,

Thank you for your reply.
Actually - the link you have sent me was the most detailed I have seen about the transaction behaviour.

However - it does not answer the questions I have raised about the state of a machine for such chained removal and chained upgrade scenario which was roll-backed.

Igal

akerl

akerl
  • Full Members
  • 104 posts

Posted 30 December 2009 - 14:39

Hi Igal,

I think that the machine state is the same as before the update or the uninstall was startet. If you start the multi package transaction wit MsiBeginTrans() the MSI will save all commit scripts for late execution. This means that the execution phase of all products are executed before the commit phase will start. If an installation fail the rollback script of all packages are exits and will use to revert the installation.

I attach an old document about MSI 4.5 functionality (comes with the Beta).

HTH and LG
Andreas

Attached Files


Edited by akerl, 30 December 2009 - 14:43.

Andreas Kerl

Inside Windows Installer 4.5
ISBN 3-86645-431-7