Posted 30 April 2004 - 18:45
If I'm calling a particular function say "foo()" from various CA's some being deferred and some immediete,is it possible for me to know in the function foo() that the call is being made from the Deferred CA?
Like this is what I'm trying to do..
I'm calling the MSIGetMode() and assuming if it returns MSIRUNMODE_SCHEDULED then it is Deferred...is that correct way of doing.
Please discuss the pros and cons and suggest.
Thanks a lot,
Posted 04 May 2004 - 08:08
Read the following:
For example, to have a custom action that calls a C/C++ dynamic link library (DLL) (Custom Action Type 1) both when the mode is MSIRUNMODE_SCHEDULED and MSIRUNMODE_ROLLBACK put two entries in the CustomAction table that call the same DLL but that have different numeric types. Include code that calls MsiGetMode to determine when to run which custom action.
Have you tested this? does it work?
Posted 04 May 2004 - 21:51
So...I'm using MsiGetMode(MSIRUNMODE_SCHEDULED)
MSIGetProperty(hInstall,"versionNT") which always fails in Deferred CA.
Posted 05 May 2004 - 01:17
Another idea i had was to run an msi query on the custom action table and check the attributes of the custom action.
Posted 05 May 2004 - 08:35
One solution that doesn't force errors would be reading the property "CustomActionData" - assuming you set a property with the CA name beforehand (assuming your CA is called "MyDeferredAction, do MsiSetProperty("MyDeferredAction", "some data"))
Posted 06 May 2004 - 01:43
but just MSIGEtMode()....my extra intelligence is of no good..
Posted 06 May 2004 - 03:02