Edwin,

No, you may use MsiOpenDatabase, but you need to be careful when and how you 
use it. For C++, try using PMSIHANDLE. Otherwise for C or other stdcall access, 
be sure to close the handle in your custom action with  
MsiCloseHandle. However, it might help to know what you're trying to accomplish 
at a high level, before commenting on the use this function.


-Matt

> Date: Tue, 5 May 2015 16:50:34 -0700
> From: egca...@gmail.com
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Modifying new msi package prior to recache in a custom   
> action
> 
> I’m trying to recache one of a number of packages before
> RemoveExistingProducts. My custom action extracts the new package from the
> Binary table, then attempts to MsiOpenDatabase() to update the new
> package’s ProductCode and ProductVersion to avoid needing a new package for
> each instance we’re trying to recache.
> 
> I’m getting Leaked MSIHANDLE messages like the following
> 
> MSI (s) (D4:84) [14:23:56:565]: Leaked MSIHANDLE (71) of type 790541 for
> thread 1380
> 
> And it appears that the custom action is terminating immediately at the
> MsiOpenDatabase() call site as no other custom action code appears to
> execute after.
> 
> I read in https://msdn.microsoft.com/en-us/library/aa370338.aspx that
> “Because MsiOpenDatabase initiates database access, it cannot be used with
> a running installation.” Does this mean that I cannot use MsiOpenDatabase()
> from a custom action and that I’ll need an external executable to run from
> my bundle instead of recaching in a custom action?
> 
> 
> -- 
> Edwin G. Castro
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
                                          
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to