cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mloebl
Level 4

Detecting Deferred mode with Managed Custom Actions

Hello,

Anyone have a sample snippet on how they are detecting deferred mode from inside their managed C# DLL? I see there is Msi.Runmode which is similair to what I used to use for my C++ DLL, but I haven't had any luck using it. Right now I check my incoming variables for empty values, but that's just a bandaide for now.

Also I do know about DTF, but choose not to use it for now... 🙂

Thanks!

-Mike
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

If you're using the InstallShield.Interop.Msi assembly, your code might look something like below. If not, you can use your own P/Invoke to MsiGetMode() to find this out.
Msi.Install install = Msi.CustomActionHandle(handle);
bool deferred = install.GetMode(Msi.RunMode.Scheduled) || install.GetMode(Msi.RunMode.Commit) || install.GetMode(Msi.RunMode.Rollback);
0 Kudos
mloebl
Level 4

MichaelU wrote:
If you're using the InstallShield.Interop.Msi assembly, your code might look something like below. If not, you can use your own P/Invoke to MsiGetMode() to find this out.
Msi.Install install = Msi.CustomActionHandle(handle);
bool deferred = install.GetMode(Msi.RunMode.Scheduled) || install.GetMode(Msi.RunMode.Commit) || install.GetMode(Msi.RunMode.Rollback);


Thank you Michael!
0 Kudos