cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
user888
Level 3

How can I detect if logging is enabled from a custom action in C++ DLL ?

Hi,

I want to detect, if logging file is enabled, from a custom action which is implemented in a C++ DLL.

I've tried using
MsiGetMode(hInstall, MSIRUNMODE_LOGENABLED)

but it always return FALSE, and I assume it is because of it falls under the condition of "Obtaining Context Information for Deferred Execution Custom Actions" (see http://msdn.microsoft.com/en-us/library/aa370543(VS.85).aspx )

I've also tried to check if command line arguments for logging were passed to the setup.exe, however when custom action is called, the current process is msiexec.exe (whose parent is also msiexec.exe) and I don't know how to get from this process to the original setup.exe which was executed by the user.
So this doesn't work either.

Any help is appreciated,
10x,
Si.
Labels (1)
0 Kudos
(1) Reply
Kelter
Level 10

i'd try querying the [MsiLogging] property. if you are running in deferred mode, you need to pass this information into the custom action by means of a "SetAProperty" CA. set a property, the name of which being the name of your CA, and the value of which being [MsiLogging]. from within your CA, call MsiGetProperty( hMSI, "CustomActionData" ).

search the forum for "CustomActionData" and "Deferred execution" and you'll get plenty of information on this whole situation.
0 Kudos