Search code examples
c#wixwindows-installerinstallshield-2012

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


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


Solution

  • 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.