How to check if custom action is running in deferred or immediate execution using WIX C#?

434 Views Asked by At

Is there a better way than catching an exception thrown when attempting to read a session variable that is not accessible in deferred mode? Thanks

1

There are 1 best solutions below

0
Michael Urman On BEST ANSWER

Look at Session.GetMode(InstallRunMode), analogous to the Session.Mode property. Note that there are three InstallRunMode values that correlate to the in-script execution scenario you're asking about: Scheduled, Rollback, and Commit.