cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tomerdr
Level 6

How to get handle for current installation?

Hi,

I have a logging function which expect handle to the current installation
How do i get this handle?

Am i allow to create a simple custom action to save it in a global variable?


Thanks in advance
Labels (1)
0 Kudos
(3) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

For InstallScript and C/C++ MSI DLL custom actions, the install handle is passed as the only parameter to your custom action function.

For VBScript type actions, the handle is implicitly used when you use the Session object (http://msdn.microsoft.com/en-us/library/aa371675(VS.85).aspx).

The install handle is not provided for EXE type custom actions.
0 Kudos
tomerdr
Level 6

to save the handle in a global variable?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

There should be no need to save the MSI handle in a global variable. You can save it in a global variable in the context of an InstallScript custom action (as in a single, discrete action). However, that global variable will be lost when the custom action ends and the next InstallScript custom action starts running, so you would need to save the handle again for each InstallScript custom action that runs.
0 Kudos