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

CA _AFTER_  moving files


4 replies to this topic

sidew

sidew
  • Members
  • 10 posts

Posted 07 March 2001 - 10:57

What is the correct method to ensure the CA is executed AFTER file copy?

TIA


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 07 March 2001 - 22:42

There are a couple of options.  You can place the custom action late in the execution sequence, I've had luck placing mine after install finalize, before remove existing products.  Another option is to set the execution of the custom action to deferred.


sidew

sidew
  • Members
  • 10 posts

Posted 08 March 2001 - 09:30

It is true. I have made some tests and I have arrived to yours same conclusion.

The best position is before the last position on execute tree.

I don't have understand the difference  from Commit Execution and Defferet execution. Can you explain me, because the manual is not very claire in this point.



SteveP

SteveP
  • Members
  • 126 posts

Posted 16 March 2001 - 01:18

According to my understanding, all the events that occur between InstallInitialize and InstallFinalize are built into an execution script at install time.  After InstallVerify (the dialog where you click NEXT to install), you can watch the action on the ProgressDlg.  You will see where the the MSI package is generating the script if you watch closely.

For 'normal' custom actions, the installer will execute the actions as it is building the execution script.  If you choose to 'defer' the custom action, what normally happens is that the action will be delayed until the position within the execution script.  This is absolutely necessary if something in the install sequence must happen before the script runs.  So setting a CA as 'deferred' delays execution until that point in the execution of the install sequence.

If you set your CA as msidbCustomActionTypeCommit , then it will execute ONLY if the IstallFinalize action is successful.

One thing to remember is that ONLY actions scheduled between InstallInitialize and InstallFinalize are scripted.  That means that any action sequenced after InstallFinalize will not be seen by the installer until after the execution script is completed.

One difference between using the msidbCustomActionTypeCommit deferral and placing the CA at the end of the sequence is that on an Uninstall action, the CA's listed after InstallFinalize will be attempted.  Those listed as msidbCustomActionTypeCommit will not ... but then you can differentiate your actions by using msidbCustomActionTypeRollback for the uninstall version of your CA, if  you need one.